Skip to content

Instantly share code, notes, and snippets.

@jhedev
Last active August 29, 2015 14:01
Show Gist options
  • Save jhedev/20bd3c40a2c3aad7105b to your computer and use it in GitHub Desktop.
Save jhedev/20bd3c40a2c3aad7105b to your computer and use it in GitHub Desktop.
Hash function in haskell
sum $ map (\(a,b) -> a*b `mod` 103) $ map (\(a,b) -> ((256^(7-a)) `mod` 103,b)) $ zip [1..] $ map (`mod` 103) $ map ord "string"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment