Skip to content

Instantly share code, notes, and snippets.

@alnsn
alnsn / u4.c
Created January 4, 2018 00:44 — forked from pkhuong/u4.c
#include <assert.h>
#include <err.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <emmintrin.h>
#include <tmmintrin.h>
@alnsn
alnsn / phash2.lua
Last active January 11, 2019 05:30
Lua module for BDZ perfect hash
-- Building block for generating a perfect not order preserving
-- non-minimal hash.
--
-- For a keyset of size N, it builds a random bipartite graph of
-- size N and order 2 * math.floor(1.0625 * N).
-- With a good probability the graph is acyclic and it's possible
-- to select one vertex from each edge/key that is guaranteed to
-- be unique. Vertices are selected by comparing two bits in
-- a bitset that has the same size as the order of the graph.
--
/*
* Copyright (C) 2016 Alexander Nasonov.
* (WINT_R macro) Copyright (C) 2005-2016 Mike Pall.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@alnsn
alnsn / afl-rump.diff
Created January 8, 2016 00:29
afl-rump.diff
--- afl-as.h.orig 2016-01-04 19:12:46.000000000 +0000
+++ afl-as.h 2016-01-07 09:13:10.000000000 +0000
@@ -494,6 +494,33 @@
" andq $0xfffffffffffffff0, %rsp\n"
"\n"
" leaq .AFL_SHM_ENV(%rip), %rdi\n"
+#ifdef __NetBSD__
+ " subq $32, %rsp\n"
+ " movq %rsp, %rsi\n"
+ " movq $32, %rdx\n"

Keybase proof

I hereby claim:

  • I am alnsn on github.
  • I am alnsn (https://keybase.io/alnsn) on keybase.
  • I have a public key whose fingerprint is E83F 6DA1 415A 1DB1 F907 6D8D 2044 9BFE FF47 EEA0

To claim this, I am signing this object: