lanyard

Types

A small type to hold the generated ID, rather than relying on a string.

pub type NanoID {
  NanoID(value: String)
}

Constructors

  • NanoID(value: String)

Values

pub fn custom_length(size: Int) -> NanoID

Generate a new NanoID using the default alphabet, but a custom length. The default alphabet is A-Z (capitals), a-z (lowercase), 0-9, and both - and _.

If a negative length is provided, this will return a blank ID.

pub fn new() -> NanoID

Generate a new NanoID using the default alphabet and length. The default alphabet is A-Z (capitals), a-z (lowercase), 0-9, and both - and _. The default length is 21

Search Document