NaCl-0.0.4.0: Easy-and-safe-to-use high-level Haskell bindings to NaCl
Safe HaskellNone
LanguageHaskell2010

NaCl.Hash

Description

Hashing.

It is best to import this module qualified:

import qualified NaCl.Hash as Hash

hash_sha256 = Hash.sha256 message
hash_sha512 = Hash.sha512 signed

This is crypto_hash_* from NaCl.

Synopsis

Documentation

type HashSha256 a = SizedByteArray CRYPTO_HASH_SHA256_BYTES a Source #

Hash returned by sha256.

This type is parametrised by the actual data type that contains bytes. This can be, for example, a ByteString.

sha256 Source #

Arguments

:: (ByteArrayAccess pt, ByteArray hashBytes) 
=> pt

Message to hash

-> HashSha256 hashBytes 

Hash a message using SHA-256.

hash = Hash.sha256 message
  • message is the data you are hashing.

type HashSha512 a = SizedByteArray CRYPTO_HASH_SHA512_BYTES a Source #

Hash returned by sha512.

This type is parametrised by the actual data type that contains bytes. This can be, for example, a ByteString.

sha512 Source #

Arguments

:: (ByteArrayAccess pt, ByteArray hashBytes) 
=> pt

Message to hash

-> HashSha512 hashBytes 

Hash a message using SHA-512.

hash = Hash.sha512 message
  • message is the data you are hashing.