5个不稳定版本
0.3.1 | 2022年8月10日 |
---|---|
0.3.0 | 2020年12月8日 |
0.2.1 | 2020年11月11日 |
0.2.0 | 2020年10月15日 |
0.1.0 | 2020年1月20日 |
#399 在 编程语言 中排名
5,696 每月下载次数
在 83 个crate中(直接使用3个) 使用
1MB
21K SLoC
blake2b-ref.rs
一个 no_std
BLAKE2B crate。
此crate由c2rust转译;源代码来自官方的BLAKE2 ref实现。转译后的源代码已稍作修改以支持no_std
。
API设计深受启发——几乎是从https://github.com/nervosnetwork/blake2b-rs复制而来。
lib.rs
:
此crate从blake2b-ref转译而来
示例
use blake2b_ref::Blake2bBuilder;
fn hash_message(msg: &[u8]) -> [u8; 32] {
let mut output = [0u8; 32];
let mut blake2b = Blake2bBuilder::new(32).personal(b"SMT").build();
blake2b.update(msg);
blake2b.finalize(&mut output);
output
}