#k256 #hash #keccak-256 #wrapper #input #elabs #k256-hash

elabs-k256

Elabs K256: Keccak-256 wrapper

1 unstable release

0.1.1 Feb 9, 2022
0.1.0 Feb 9, 2022

#2 in #k256

GPL-3.0 license

14KB

Elabs-k256

Elabs-k256 is a wrapper around the tiny_keccak::Keccak::v256() Hasher. It give a simple interface to use the Hasher.

Usage

To use elabs_k256, you need to import the elabs_k256 crate and use the k256 or k256_hash function.

[dependencies]
elabs_k256 = "0.1"

Example

use elabs_k256::k256;
//!
fn main() {
   let input = "Hello World";
   let hash = k256(input);
   println!("{:?}", hash);
}
use elabs_k256::k256_hash;
//!
fn main() {
  let input = "Hello World";
  let mut hash = [0u8; 32];
  k256_hash(input, &mut hash);
  println!("{:?}", hash);
}

lib.rs:

Elabs-k256 is a wrapper around the tiny_keccak::Keccak::v256() Hasher. It give a simple interface to use the Hasher.

Usage

To use elabs_k256, you need to import the elabs_k256 crate and use the k256 or k256_hash function.

[dependencies]
elabs_k256 = "0.1"

Example

use elabs_k256::k256;

fn main() {
   let input = "Hello World";
   let hash = k256(input);
   println!("{:?}", hash);
}
use elabs_k256::k256_hash;

fn main() {
  let input = "Hello World";
  let mut hash = [0u8; 32];
  k256_hash(input, &mut hash);
  println!("{:?}", hash);
}

Dependencies

~55KB