5 releases

Uses new Rust 2024

0.2.0-rc.2 Feb 2, 2026
0.2.0-rc.1 Jan 24, 2026
0.1.3 Sep 3, 2022
0.1.2 Jun 16, 2022
0.0.0 Dec 16, 2016

#2968 in Cryptography

Download history 4186/week @ 2025-10-22 2704/week @ 2025-10-29 4435/week @ 2025-11-05 11979/week @ 2025-11-12 9722/week @ 2025-11-19 4602/week @ 2025-11-26 2760/week @ 2025-12-03 2983/week @ 2025-12-10 6880/week @ 2025-12-17 2400/week @ 2025-12-24 1969/week @ 2025-12-31 8604/week @ 2026-01-07 3011/week @ 2026-01-14 6980/week @ 2026-01-21 7089/week @ 2026-01-28 8670/week @ 2026-02-04

27,502 downloads per month
Used in 8 crates

MIT/Apache

350KB
2.5K SLoC

RustCrypto: FSB

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

Pure Rust implementation of the FSB cryptographic hash algorithms.

There are 5 standard versions of the FSB hash function:

  • FSB-160
  • FSB-224
  • FSB-256
  • FSB-384
  • FSB-512

Examples

Output size of FSB-256 is fixed, so its functionality is usually accessed via the Digest trait:

use fsb::{Digest, Fsb256};
use hex_literal::hex;

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

assert_eq!(hash, hex!("0f036dc3761aed2cba9de586a85976eedde6fa8f115c0190763decc02f28edbc"));

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

Also, see the examples section in the RustCrypto/hashes readme.

License

The crate is licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies