Crate armnod

Source
Expand description

§armnod

Armnod is an anagram for “random”; Armnod is a library for working with random strings.

Each Armnod consists of a SeedChooser, LengthChooser, and CharacterChooser which compose a set of random strings. The SeedChooser picks the element of the set. It may say to stop iterating (enough items have been chosen), it may say to seek to a particular offset in another guacamole generator (there’s a finite number of seeds), or it may say to not seek at all (an “infinite” number of strings are possible).

The SeedChooser and LengthChooser both pull from a guacamole::Guacamole stream to generate the seed and a u32 for the string’s length. It’s easy to see that when the guac is positioned at the same point in the stream, the seed and length will be the same.

CharacterChooser pulls bytes from the string and maps them to characters to create a string. Essentially mapping the binary data to ASCII data. UTF-8 marginally supported.

§Status

Passive development. The warts pulled it from being maintenance track on 2023-09-19

§Scope

This library provides the armnod type and an embeddable command-line interface.

§Warts

  • The ArmnodOptions does not create the Armnod instance; it should.

§Documentation

The latest documentation is always available at docs.rs.

Structs§

Armnod
Armnod is an anagram of Random
ArmnodOptions
Options for constructing an Armnod instance.
CharSetChooser
Choose characters from alphabets of up to 96 characters.
ConstantLengthChooser
ConstantLengthChooser generates strings of uniform length.
RandomStringChooser
RandomStringChooser skips seeding entirely. This saves on CPU for when all that’s needed are pseudo-random strings.
SetStringChooser
Choose strings from a set of strings with uniform probability.
SetStringChooserOnce
Return a range of strings over [start, limit).
SetStringChooserZipf
Draw values according to a Zipf distribution.
UniformLengthChooser
UniformLengthChooser generates strings with a uniform distribution between a minimum and maximum length.

Enums§

SeedChoice
SeedChoice chooses the string to be generated from one of three possibilities. The first could be to not generate anything and stop iterating. This is useful, e.g., when the SeedChoice generates each string exactly once for purposes of loading data. The second choice is to skip seeding. This will avoid a seek at the lower level random number generator, but it means the data generated will truly span the domain of Guacamole.

Constants§

CHAR_SET_ALNUM
The alnum character set includes lower- and upper-case ASCII alphabets and the digits.
CHAR_SET_ALPHA
The alph character set includes lower- and upper-case ASCII alphabets.
CHAR_SET_DEFAULT
The default character set includes most printable ASCII.
CHAR_SET_DIGIT
The digit character set includes ASCII digits.
CHAR_SET_HEX
The hex character set includes lower-case hexadecimal numbers.
CHAR_SET_LOWER
The lower character set includes lower-case ASCII alphabets.
CHAR_SET_PUNCT
The punct character set includes ASCII punctuation.
CHAR_SET_UPPER
The upper character set includes upper-case ASCII alphabets.

Traits§

CharacterChooser
Generate strings of a given alphabet using the provided randomness.
LengthChooser
Given Guacamole, generate a string length for the next string.
SeedChooser
A SeedChooser returns a SeedChoice using the next value drawn from guac.