0.1.0 • Published 2 years ago

@antonmisa/rust-password-wasm v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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.