#random-string #key #base32 #scheme #uuid #api #base62

api_key

Generate api key in rust supports base32, base62, string, uuid4, uuid5

1 unstable release

0.1.0 Mar 25, 2024

#2 in #base62

Download history 123/week @ 2024-03-23 25/week @ 2024-03-30 23/week @ 2024-04-06 3/week @ 2024-04-13 14/week @ 2024-05-11 43/week @ 2024-05-18 15/week @ 2024-05-25

72 downloads per month

MIT license

21KB
718 lines

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

Dependencies

~3.5–4.5MB
~76K SLoC