Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly Language > hash function
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 5017 of 5163
Post > Topic >>

hash function

by "rio" <a@[EMAIL PROTECTED] > May 24, 2008 at 08:46 AM

What about a function like below ?

;  u32   hash(u8*   P1)
hash:
      mov  edx, [esp+4]
      xor    eax, eax
      cmp   edx, 0
      je  .f
      xor    ecx, ecx
..0:  mov  al, [edx]
      add  ecx, eax
      inc   edx
      cmp  eax, 0
      jne   .0
      mov  eax, ecx
      xor    edx, edx
      mov  ecx, HASHSIZE
      div  ecx
      mov  eax, edx
..f:
ret  4

hash:  r=[s+4]; a^=a; r==0#.f; c^=c;
..0:      al=[r]; c+=a; ++r; a#.0
          a=c; r^=r; c=4019; div c; a=r
..f:       ret 4
 




 2 Posts in Topic:
hash function
"rio" <a@[EM  2008-05-24 08:46:56 
Re: hash function
Bartosz =?iso-8859-1?Q?W=  2008-05-25 01:35:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 9:06:29 CDT 2008.