@antonmisa/rust-password-wasm
v0.1.0
Published
This library implements wasm binding for rust password generator (https://github.com/antonmisa/rust_password) in pure Rust. It's easy to use it in web projects implementing React, NodeJs or Vanilla Html and s.o.
Downloads
3
Readme
Rust Password Generator Wasm Binding
This library implements wasm binding for rust password generator (https://github.com/antonmisa/rust_password) in pure Rust. It's easy to use it in web projects implementing React, NodeJs or Vanilla Html and s.o.
Build manual
> wasm-pack build
Installation manual
"dependencies": {
"rust-password-wasm": "file:path to rust-password-wasm/pkg"
Installation npm
npm install
Usage
pub fn main() {
// Generate a password that is 64 characters long with 10 digits, 10 symbols,
// allowing upper and lower case letters, disallowing repeat characters.
let password: Generator = Generator::new(&None);
match password.generate(64, 10, 10, false, false) {
Ok(x) => x,
Err(e) => log::error!("{}", e),
};
}
License
This code is licensed under the MIT license.