module Hash

: sig

Secure hashes.

type digest_context
val create : string -> digest_context

Create a new context from an algorithm name. Supported names are "sha1" and "sha256".

val update : digest_context -> string -> unit

Add bytes to a context.

val hex_digest : digest_context -> string

Return the final digest of ctx as an ASCII string. ctx cannot be used after this.

val b32_digest : digest_context -> string

Return the digest as a base-32-encoded ASCII string (with no padding characters)

val update_from_channel : digest_context -> Pervasives.in_channel -> unit

Read until the end of the channel, adding each byte to the digest.