#hash #digest #stb #belt #crypto

无 std belt-hash

BelT 哈希函数 (STB 34.101.31-2020)

8 个版本

0.2.0-pre.42024 年 7 月 26 日
0.2.0-pre.32024 年 2 月 1 日
0.2.0-pre.22024 年 1 月 17 日
0.1.1 2023 年 11 月 22 日
0.0.0 2022 年 9 月 15 日

#2575 in 加密学

Download history 49/week @ 2024-04-23 37/week @ 2024-04-30 342/week @ 2024-05-07 12/week @ 2024-05-14 15/week @ 2024-05-21 134/week @ 2024-05-28 139/week @ 2024-06-04 16/week @ 2024-06-11 77/week @ 2024-06-18 104/week @ 2024-06-25 42/week @ 2024-07-02 176/week @ 2024-07-09 24/week @ 2024-07-16 877/week @ 2024-07-23 177/week @ 2024-07-30 129/week @ 2024-08-06

1,210 每月下载量
用于 3 crates

MIT/Apache

12KB
193

RustCrypto: BelT 哈希

crate Docs Build Status Apache2/MIT licensed Rust Version Project Chat

纯 Rust 实现 BelT 哈希函数,该函数由 STB 34.101.31-2020 规定。

示例

use belt_hash::{BeltHash, Digest};
use hex_literal::hex;

let mut hasher = BeltHash::new();
hasher.update(b"hello world");
let hash = hasher.finalize();

assert_eq!(hash, hex!("afb175816416fbadad4629ecbd78e1887789881f2d2e5b80c22a746b7ac7ba88"));

// Hex-encode hash using https://docs.rs/base16ct
let hex_hash = base16ct::lower::encode_string(&hash);
assert_eq!(hex_hash, "afb175816416fbadad4629ecbd78e1887789881f2d2e5b80c22a746b7ac7ba88");

还可以参考 RustCrypto/hashes 中的 示例部分

最低支持的 Rust 版本

Rust 1.71 或更高版本。

最低支持的 Rust 版本可能在将来更改,但将通过小版本号升级来完成。

语义版本控制策略

  • 此库的所有默认功能都受语义版本控制覆盖
  • MSRV 被视为免于语义版本控制,如上所述

许可

此包根据您的选择受以下任一许可协议的约束

贡献

除非您明确说明,否则任何有意提交以包含在您的工作中的贡献,根据 Apache-2.0 许可证的定义,应按上述方式双许可,不附加任何额外条款或条件。

依赖项

~325–540KB
~12K SLoC