Skip to content

Instantly share code, notes, and snippets.

@daschl
Created July 1, 2014 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daschl/e1d8799b7e01538308d0 to your computer and use it in GitHub Desktop.
Save daschl/e1d8799b7e01538308d0 to your computer and use it in GitHub Desktop.
┌─[✗]─[michael@daschlbase]─[~/code/rust/ketama]
└──╼ cargo build
Fresh rust-crypto v0.1.0 (https://github.com/DaGenix/rust-crypto.git)
Compiling ketama-rs v0.1.0 (file:/Users/michaelnitschinger/code/rust/ketama)
src/ketama.rs:12:5: 12:19 error: type `rust-crypto::md5::Md5` does not implement any method in scope named `input_str`
src/ketama.rs:12 sh.input_str(key);
^~~~~~~~~~~~~~
src/ketama.rs:13:13: 13:25 error: type `rust-crypto::md5::Md5` does not implement any method in scope named `result_str`
src/ketama.rs:13 println(sh.result_str());
^~~~~~~~~~~~
error: aborting due to 2 previous errors
Could not execute process `rustc src/ketama.rs --crate-type bin --out-dir /Users/michaelnitschinger/code/rust/ketama/target -L /Users/michaelnitschinger/code/rust/ketama/target -L /Users/michaelnitschinger/code/rust/ketama/target/deps` (status=101)
extern crate crypto = "rust-crypto";
use std::io::stdio::println;
use crypto::md5::Md5;
fn main() {
let key = "Hello world!";
let sh = Md5::new();
sh.input_str(key);
println(sh.result_str());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment