Well
MakePair_II
Code:
function MakePair_II takes integer x,integer y returns location
return Location(ItoR(x),ItoR(y))
endfunction
DeletePair
Code:
function DeletePair takes location oPair returns nothing
call RemoveLocation(oPair)
endfunction
Char2int
Code:
function Char2Int takes string c returns integer
local string cset="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
local integer i=0
local integer len=StringLength(cset)
loop
exitwhen(c==SubString(cset,i,i+1))or(i>=len)
set i=i+1
endloop
return i
endfunction
First_I, Rest_I
Code:
function First_I takes location oPair returns integer
return RtoI(GetLocationX(oPair))
endfunction
function Rest_I takes location oPair returns integer
return RtoI(GetLocationY(oPair))
endfunction
Hashblock
Code:
function hashblock takes location oHash,integer c returns nothing
local integer n=1
local integer delta=11742
local integer sum=0
local integer k1=5168478+c
local integer k2=2763741+c
local integer h1=First_I(oHash)
local integer h2=Rest_I(oHash)
loop
exitwhen n>32
set h1=h1+((h2*16)+(h2/32))+h2+sum+k1
set sum=sum+delta
set h2=h2+((h1*16)+(h1/32))+h1+sum+k2
set n=n+1
endloop
call SetPair_II(oHash,h1,h2)
endfunction
I have no idea what the function for MakePair, DeletePair, and the First_I End_I do. The Char2int function displayed all the alphabets and numbers which at the end will go through various convertions.
But for 1 reference.
Code:
function hashstring takes string s returns boolean
local integer istring=0
local integer n=0
local integer len=StringLength(s)
local location oHash=MakePair_II(0,0)
loop
exitwhen n>=len
set istring=Char2Int(SubString(s,n,n+1))
call hashblock(oHash,istring)
set n=n+1
endloop
if(First_I(oHash)==0x51D3AA57)then
if(Rest_I(oHash)==-683500700)then
call DeletePair(oHash)
set oHash=null
return true
endif
endif
call DeletePair(oHash)
set oHash=null
return false
endfunction
The convertion for that code turns out to be "-secret past". Which I have no idea how it get to that number/unit wise.