api_key

Crates.ioapi_key
lib.rsapi_key
version0.1.0
sourcesrc
created_at2024-03-25 13:11:11.960226
updated_at2024-03-25 13:11:11.960226
descriptionGenerate api key in rust supports base32, base62, string, uuid4, uuid5
homepage
repository
max_upload_size
id1185289
size24,799
Jeffrey Emakpor (BadMask121)

documentation

README

api_key

A Rust utility for generating API keys including random strings, UUIDs, and keys based on specific encoding schemes like Base32 and Base62.

Rust port of https://github.com/pauldenver/generate-api-key

Example for generating random string with prefix

 let options = StringGenerator {
    prefix: String::from("PREFIX"),
    ..StringGenerator::default()
  };

  let key: ApiKeyResults = api_key::string(options);

  assert!(match key {
    ApiKeyResults::String(d) => d.starts_with("PREFIX"),
    _ => false,
  })
  • improve crate documentation
  • improve README
Commit count: 0

cargo fmt