MLton.hash deeply flawed

View: New views
1 Messages — Rating Filter:   Alert me  

MLton.hash deeply flawed

by Wesley W. Terpstra :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Strings that differ in only a few places don't get unique hash values
from MLton.hash. In a program where I tried to use MLton.hash I had 38
collisions out of 8325 distinct input strings. Not good.

val x = "klahjflaskjflaksjfgklajsglkasjglaksjglaksjglaksgjaklsgaslkgjaslgkjas"
val y = "klahjflbskjflaksjfgklajsglkasjglaksjglaksjglaksgjaklsgaslkgjaslgkjaS"

val () = print (Word32.toString (MLton.hash x) ^ "\n")
val () = print (Word32.toString (MLton.hash y) ^ "\n")

_______________________________________________
MLton mailing list
MLton@...
http://mlton.org/mailman/listinfo/mlton