While it is not guaranteed to provide a unique value for every string, it does a pretty good job!
THIS IS NOT A SECURE HASH, and should not be used for security purposes.
The value is that it's simple and very fast to execute.
Code: Select all
02000 DEF Fnhash(&Hash_String$)
02010 LET Hash=0
02020 FOR _Hash=1 TO Len(Hash_String$)
02030 LET Hash+=Mod( (_Hash*Ord(Hash_String$(_Hash:_Hash))) , Inf )
02040 NEXT _Hash
02050 LET Fnhash=Hash