marsupial
a rust wrapper for xkcp/k12, derived entirely from oconnor663/kangarootwelve_xkcp.rs
the only differences are:
- updated crate dependencies
- updated xkcp/k12
- the removal of
k12sum - changed branding
- benchmarks modified to use the criterion crate to allow benchmarking on stable rust
- doesn't need bindgen installed system-wide
usage
in order to use the crate, you need:
- a c compiler
- rust
- gnuplot (if you want plot generation when benchmarking)
then, just add a dependency upon the marsupial crate in Cargo.toml, and
then you can use it like this:
use Hasher;
// hash an input all at once
let hash1 = hash;
// hash an input incrementally
let mut hasher = new;
hasher.update;
hasher.update;
hasher.update;
let hash2 = hasher.finalize;
assert_eq!;
// extended output. `OutputReader` also implements `Read`
let mut hasher = new;
hasher.update;
let mut output_reader = hasher.finalize_xof;
let mut output = ;
output_reader.squeeze;
assert_eq!;
// emit the hash as hexadecimal
println!;
license
as is with kangarootwelve_xkcp.rs, all of the rust wrapping code is dedicated
to the public domain via
cc0. the vendored
xkcp code is covered by a
mixture of licenses