Skip to content

Instantly share code, notes, and snippets.

@NecroTechno
Created December 30, 2015 05:05
Show Gist options
  • Save NecroTechno/64421aea98b25cb7dfe1 to your computer and use it in GitHub Desktop.
Save NecroTechno/64421aea98b25cb7dfe1 to your computer and use it in GitHub Desktop.
extern crate crypto;
use crypto::digest::Digest;
use crypto::sha2::Sha256;
use std::fs::File;
use std::io::prelude::*;
use std::io::BufReader;
use std::path::Path;
use std::str;
use std::io;
use std::env;
fn main() {
let mut hasher = Sha256::new();
let args: Vec<String> = env::args_os().map(|s| s.into_string().unwrap()).collect();
let args_slice: &str = &args[1];
hasher.input_str(args_slice);
let hex = hasher.result_str();
println!("{:?}", hex);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment