Module Crypto.Hash

This library contains operations to support simple cryptography hashing. Currently, it is based on Unix tools.

Author: Michael Hanus

Summary of exported operations:

getHash :: String -> IO String  Deterministic 
Default hashing function.
getHashWith :: String -> String -> IO String  Deterministic 
Hashes a string with an explicit Unix hash command.
randomString :: Int -> IO String  Deterministic 
Returns a random string (a hexadecimal string) of a particular length.

Exported operations:

getHash :: String -> IO String  Deterministic 

Default hashing function.

Example call:
(getHash toHash)
Parameters:
  • toHash : string which should be hashed
Returns:
the hashSum of this str

getHashWith :: String -> String -> IO String  Deterministic 

Hashes a string with an explicit Unix hash command.

Example call:
(getHashWith hashcmd toHash)
Parameters:
  • hashcmd : Unix command for hasing
  • toHash : string which should be hashed
Returns:
the hashed string

randomString :: Int -> IO String  Deterministic 

Returns a random string (a hexadecimal string) of a particular length.

Example call:
(randomString length)
Parameters:
  • length : length of the desired string
Returns:
the random string