Expand description

A minimal implementation of SHA1 for rust.

This implementation supports no_std which is the default mode. The following features are available and can be optionally enabled:

  • serde: when enabled the Digest type can be serialized.
  • std: when enabled errors from this library implement std::error::Error and the hexdigest shortcut becomes available.


let mut m = sha1_smol::Sha1::new();
m.update(b"Hello World!");

The sha1 object can be updated multiple times. If you only need to use it once you can also use shortcuts (requires std):

assert_eq!(sha1_smol::Sha1::from("Hello World!").hexdigest(),


Digest generated from a Sha1 instance.

Indicates that a digest couldn’t be parsed.

Represents a Sha1 hash object in memory.


The length of a SHA1 digest in bytes