diff options
author | Malfurious <m@lfurio.us> | 2022-01-15 21:08:59 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2022-01-15 21:08:59 -0500 |
commit | f97d1f18030f7afc171db9ba9c0bed597717e64c (patch) | |
tree | 065b8724a0ff0a0757732510ef889ae62989589a /src/demo_hash.rs | |
parent | 977317cb3ecf79695f3750f5d88df8ed223b4b22 (diff) | |
download | SorensenCompression-master.tar.gz SorensenCompression-master.zip |
Everything has been reimplemented in C.
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to '')
-rw-r--r-- | src/demo_hash.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/demo_hash.rs b/src/demo_hash.rs deleted file mode 100644 index 115a10f..0000000 --- a/src/demo_hash.rs +++ /dev/null @@ -1,23 +0,0 @@ -use sha2::Digest; - -pub fn hash_bigint(n: usize, i: &num::BigInt) -> Vec<u8> -{ - let (_, bytes) = i.to_bytes_be(); - assert!(bytes.len() <= n); - - let mut hash = sha2::Sha512::new(); - hash.input(vec![0; n - bytes.len()]); - hash.input(bytes); - - hash.result().to_vec() -} - -pub fn show_hash(h: &Vec<u8>) -{ - for x in h - { - print!("{:02x}", x); - } - - println!(); -} |