Secwords
secure and safe password container.
| Docs | Latest Note |
toml
[dependencies]
secwords = "2.1.0"
or
toml
[dependencies]
secwords = { version = "2.1.0", default-features = false } # no-std
How to
``rust
use secwords::Password;
use sha2::Sha256; // can be any hasher of dyn Digest
digest` crate
let plain = String::from("pa5$wOrs"); // <- example
let pass1 = Password::
asserteq!(pass1, pass2); // they are hashed, original is gone(safely)
asserteq!(pass1.len(), 32); // fixed size vep
(crate)
asserteq!(pass1.asref(), pass2.asslice());
asserteq!(pass1.tovec(), pass2.tovec());
asserteq!(pass1, "pa5$wOrs"); asserteq!(pass1, String::from("pa5$wOrs")); asserteq!(&pass1.tohex().unwrap()[..20], "0f521249b366dd6e0acc"); asserteq!(format!("{}", pass1), "*SECURE*"); // display asserteq!(format!("{:?}", pass1), "SECURE"); // debug
let bytes = pass1.tobytes(); // encode
let pass3 = Password::
let hexstring = pass1.tohex().unwrap(); // encode
let pass3 = Password::
there are more examples in the
lib.rs`