Character set creator. Maps numeric values to strings using the character set as digits.

Hierarchy (view full)

Properties

MAXIMUM_STRING_LENGTH: 40 = 40

Maximum string length supported.

Constructors

Accessors

  • get characterSet(): readonly string[]
  • Get the character set.

    Returns readonly string[]

  • get characterSetSize(): number
  • Get the character set size.

    Returns number

  • get exclusionSupport(): readonly Exclusion[]
  • Get the exclusions supported by the character set.

    Returns readonly Exclusion[]

Methods

  • Get a power of 10.

    Parameters

    • power: number

      Power.

    Returns bigint

    10**power.

  • Create a string by mapping a value to the equivalent characters in the character set across the length of the string.

    Parameters

    • length: number

      Required string length.

    • value: number | bigint

      Numeric value of the string.

    • Optionalexclusion: Exclusion

      Strings to be excluded from the range of outputs. See Exclusion for possible values and their meaning.

    • Optionaltweak: number | bigint

      If provided, the numerical value of the string is "tweaked" using an encryption transformer.

    • OptionalcreationCallback: CreationCallback

      If provided, called after the string is constructed to create the final value.

    Returns string

    String created from the value.

  • Create multiple strings by mapping each value to the equivalent characters in the character set across the length of the string. Equivalent to calling this method for each individual value.

    Parameters

    • length: number

      Required string length.

    • values: Iterable<number | bigint, any, any>

      Numeric values of the strings.

    • Optionalexclusion: Exclusion

      Strings to be excluded from the range of outputs. See Exclusion for possible values and their meaning.

    • Optionaltweak: number | bigint

      If provided, the numerical value of the strings are "tweaked" using an encryption transformer.

    • OptionalcreationCallback: CreationCallback

      If provided, called after each string is constructed to create the final value.

    Returns IterableIterator<string, any, any>

    Iterable iterator over strings created from the values.

  • Create a string or multiple strings. This signature exists to allow similar overloaded methods in other classes to call this method correctly.

    Parameters

    • length: number
    • valueOrValues: number | bigint | Iterable<number | bigint, any, any>
    • Optionalexclusion: Exclusion
    • Optionaltweak: number | bigint
    • OptionalcreationCallback: CreationCallback

    Returns string | IterableIterator<string, any, any>

  • Determine the value for a string.

    Parameters

    • s: string

      String.

    • exclusion: Exclusion = Exclusion.None

      Strings excluded from the range of inputs. See Exclusion for possible values and their meaning.

    • Optionaltweak: number | bigint

      If provided, the numerical value of the string was "tweaked" using an encryption transformer.

    Returns bigint

    Numeric value of the string.

  • Get the index for a character.

    Parameters

    • c: string

      Character.

    Returns undefined | number

    Index for the character or undefined if the character is not in the character set.

  • Get the indexes for all characters in a string.

    Parameters

    • s: string

      String.

    Returns readonly (undefined | number)[]

    Array of indexes for each character or undefined if the character is not in the character set.

  • Validate a string. If the string violates the character set or any of the character set validation parameters, an exception is thrown.

    Parameters

    Returns void