3 unstable releases
0.2.1 | Dec 4, 2024 |
---|---|
0.2.0 | Dec 4, 2024 |
0.1.0 | Dec 4, 2024 |
#738 in Cryptography
373 downloads per month
Used in utxo_detective_block_head…
25KB
565 lines
Utxo Detective's Cryptography Crate
A Rust library providing Bitcoin-compatible cryptographic primitives.
Features
- SHA256 hashing implementation
- Double SHA256 (SHA256d) hashing - commonly used in Bitcoin
- RIPEMD160 hashing
- HASH160 hashing (RIPEMD160(SHA256))
- Pure Rust implementation
- Zero dependencies
License
This project is licensed under the MIT License.
lib.rs
:
Bitcoin-compatible cryptographic primitives
This crate provides cryptographic functions commonly used in Bitcoin, including:
- SHA256 hashing
- Double SHA256 (SHA256d) hashing
- RIPEMD160 hashing
Examples
use utxo_detective_cryptography::Hash;
// Simple SHA256 hash
let input = b"hello world";
let hash = Hash::sha256(input);
// Double SHA256 (commonly used in Bitcoin)
let double_hash = Hash::sha256d(input);
// RIPEMD160 hash
let ripemd_hash = Hash::ripemd160(input);