hypersig/digest
Types
pub type Digest {
Digest(method: crypto.HashAlgorithm, digest: BitArray)
}
Constructors
-
Digest(method: crypto.HashAlgorithm, digest: BitArray)
pub type DigestHeader =
List(Digest)
Values
pub fn from_string(
header: String,
) -> Result(Digest, error.HyperError)
pub fn new(data: BitArray) -> Digest
Hashes the data using Sha256 and creates a Digest object
pub fn parse_header(
header: String,
) -> Result(List(Digest), error.HyperError)
pub fn verify(digest: Digest, data: BitArray) -> Bool
Verifies the given digest object matches the given data
pub fn verify_header(
header: List(Digest),
data: BitArray,
) -> Bool
Verify all digests in a given header against the given data
pub fn with_method(
method: crypto.HashAlgorithm,
data: BitArray,
) -> Digest
Hashes the data with the given method and creates a Digest object