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   
Default hashing function.
getHashWith :: String -> String -> IO String   
Hashes a string with an explicit Unix hash command.
randomString :: Int -> IO String   
Returns a random string (a hexadecimal string) of a particular length.

Exported operations:

getHash :: String -> IO String   

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   

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   

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