Skip to content

Instantly share code, notes, and snippets.

View czlc's full-sized avatar

czlc czlc

  • None
View GitHub Profile
unsigned int RSHash(const char* str, unsigned int len)
{
unsigned int b = 378551;
unsigned int a = 63689;
unsigned int hash = 0;
unsigned int i = 0;
for(i = 0; i < len; str++, i++)
{
hash = hash * a + (*str);
local to_double , from_double
do
local s , e , d
-- Can't use with to_double as we can't strip debug info :(
d = string.dump ( loadstring ( [[return 523123.123145345]] ) )
s , e = d:find ( "\3\54\208\25\126\204\237\31\65" )
s = d:sub ( 1 , s )
e = d:sub ( e+1 , -1 )
function to_double ( n )