Skip to content

Instantly share code, notes, and snippets.

@csthompson
csthompson / djb2_hash
Created October 5, 2013 03:40
Hashing
unsigned long
hash(unsigned char *str)
{
unsigned long hash = 5381;
int c;
while (c = *str++)
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
return hash;
@csthompson
csthompson / 0_reuse_code.js
Created October 5, 2013 03:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console