ktonon/elm-crypto/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Crypto.HMAC

Compute HMAC SHA message digests.

digest : Hash -> Key -> Message -> String

HMAC SHA256 digest.

Crypto.HMAC.digest sha256 "key" "The quick brown fox jumps over the lazy dog"
--> "f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8"


Crypto.HMAC.digest sha512 "key" "I ❤ cheese"
--> "a885c96140f95cb0b326306edfba49afbb5d38d3a7ed6ccfd67153429cbd3c56d0c514fcaa53b710bb7ba6cc0dfedfdb4d53795acbeb48eb23aa93e5ce9760dd"
type alias Key =
String

Secret key

type alias Message =
String

Message to be hashed

Hash Algorithms

type Hash

Type of hash algorithm.

sha224 : Hash

Use SHA224 as the hash algorithm.

sha256 : Hash

Use SHA256 as the hash algorithm.

sha384 : Hash

Use SHA224 as the hash algorithm.

sha512 : Hash

Use SHA256 as the hash algorithm.