short_id
A short id of len characters drawn from an Alphabet with a seedable generator, every
character equally likely.
The same generator state always gives the same id, which makes it right for tests and
reproducible fixtures, and wrong for anything secret (a 64-bit seed can be guessed): use
new_short_id (feature random-entropy) for tokens.
Import
Section titled “Import”Cargo feature id (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
alphabet | &Alphabet | The characters to draw from. |
len | usize | The number of characters. |
rng | &mut Rng | The generator that decides them. |
Returns
Section titled “Returns”String — A string of len characters (len characters, not bytes, for a non-ASCII alphabet).
