This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n + ( 8 -1) & ~(8-1) |
NewerOlder