mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 18:51:02 +00:00
Add sha2-256 hash function (#4218)
* Add sha2-256 hash function Widely used hash function, supported by bitcoin and ethereum * Add runtime io support * add test * add test * Update hashing.rs * Update hashing.rs
This commit is contained in:
@@ -384,6 +384,11 @@ pub trait Hashing {
|
||||
primitives::hashing::keccak_256(data)
|
||||
}
|
||||
|
||||
/// Conduct a 256-bit Sha2 hash.
|
||||
fn sha2_256(data: &[u8]) -> [u8; 32] {
|
||||
primitives::hashing::sha2_256(data)
|
||||
}
|
||||
|
||||
/// Conduct a 128-bit Blake2 hash.
|
||||
fn blake2_128(data: &[u8]) -> [u8; 16] {
|
||||
primitives::hashing::blake2_128(data)
|
||||
|
||||
Reference in New Issue
Block a user