Rust sha256 sample code
use sha2::{Sha256, Digest};
use hex;
fn encode(input: &[u8]) -> String {
let mut hasher = Sha256::new();
hasher.update(input);
let result = hasher.finalize();
hex::encode(result)
}
fn main() {
let input = "1234567";
let encoded = encode(input.as_bytes());
println!("Encoded: {}", encoded);
}