Created
March 6, 2012 16:12
-
-
Save MgaMPKAy/1987121 to your computer and use it in GitHub Desktop.
DJBX33A
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DJBX33A where | |
import Data.Char (ord) | |
djbx33a :: String -> Int | |
djbx33a str = foldl (\a c -> a * 33 + ord c) 5381 str | |
djbx :: Int -> Int -> String -> Int | |
djbx times init str = foldl (\a c -> a * times + ord c) init str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment