%integer %array r(0:2047)
%integer %function hash(%string(255) s)
   %integer res, si, bi, c

   res = 0
   %for si = 1, 1, length(s) %cycle
      c = charno(s, si)
      %for bi = 1, 1, 8 %cycle
         res = res!!r((si-1)<<3+bi) %if c&1#0
         c = c>>1
      %repeat
   %repeat
   %result = res
%end
%routine init hash
   %integer ri, bi, rand, this rand, bit
   rand = cputime
   this rand = 0
   %for ri = 0, 1, 2047 %cycle
      %for bi = 0, 1, 32 %cycle
         %cycle
            %if rand&1=1 %start
               bit = 1
               rand = (rand>>1)!!16_80030001
            %else
               bit = 0
               rand = rand>>1
            %finish
            %exit %if rand#0
            rand = cputime
         %repeat
         this rand = this rand<<1+bit
      %repeat
      r(ri) = this rand
   %repeat
%end
