Skip to content

A simple implementation of the SHA hashing algorithms, seems to work right!

License

Notifications You must be signed in to change notification settings

ImmutableVariable/SHA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SHA

This is my implementations of the SHA-1 and SHA-256 hashing algorithms in Rust. DO NOT USE THIS CODE FOR ANYTHING PRODUCTION. This is just a learning exercise for me. I might add more sha algorithms in the future.

Usage

Sha 1 (or sha256)

use sha::sha1::hash; // or sha::sha256::hash

fn main() {
    let message = b"hello world";
    let hash = hash(message);    
    println!("{:?}", hash);

    // print the hash as a hex string
    for h in hash.iter() {
        print!("{:x}", h);
    }
    println!();
}

About

A simple implementation of the SHA hashing algorithms, seems to work right!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages