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.

Revisions

  1. jhedev revised this gist May 13, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hash function
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    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"
    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"
  2. jhedev renamed this gist May 13, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. jhedev created this gist May 13, 2014.
    1 change: 1 addition & 0 deletions gistfile1.hs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    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"