3 unstable releases
0.2.0 | Jul 22, 2020 |
---|---|
0.1.1 | Jul 17, 2020 |
0.1.0 | Jun 29, 2020 |
#1440 in Cryptography
126,858 downloads per month
Used in 118 crates
(5 directly)
18KB
426 lines
const-sha1
A sha1 implementation useable in const contexts.
Use
const fn signature() -> [u32; 5] {
const_sha1::sha1(stringify!(MyType).as_bytes()).data
}
Minimum Supported Rust Version (MSRV)
This crate requires Rust 1.46.0-beta or newer due to the use of some const expression features.
Attribution
This code is largely inspired by the following repos:
lib.rs
:
A const evaluated sha1 function.
Use
const fn signature() -> const_sha1::Digest {
const_sha1::sha1(&const_sha1::ConstBuffer::from_slice(stringify!(MyType).as_bytes()))
}