Class SerializableNumericIdentificationKeyCreator

Serializable numeric identification key creator.

Hierarchy

Properties

leaderType: LeaderType
identificationKeyType: IdentificationKeyType
prefixType: PrefixType
length: number
referenceCharacterSet: CharacterSet
referenceValidator: CharacterSetValidator

Constructors

  • Constructor. Called internally by PrefixManager serialized numeric identification key creator getters; should not be called by other code.

    Parameters

    • prefixManager: PrefixManager

      Prefix manager.

    • identificationKeyType: IdentificationKeyType

      Identification key type.

    • length: number

      Length.

    • serialComponentLength: number

      Serial component length.

    • serialComponentCharacterSet: CharacterSet

      Serial component character set.

    Returns SerializableNumericIdentificationKeyCreator

Accessors

  • get serialComponentLength(): number
  • Get the serial component length.

    Returns number

  • get serialComponentCharacterSet(): CharacterSet
  • Get the serial component character set.

    Returns CharacterSet

  • get serialComponentValidation(): CharacterSetValidation
  • Get the serial component validation parameters.

    Returns CharacterSetValidation

  • get serialComponentValidator(): CharacterSetValidator
  • Get the serial component validator.

    Returns CharacterSetValidator

  • get capacity(): number
  • Returns number

  • get tweak(): bigint
  • Get the tweak for sparse creation.

    Returns bigint

  • set tweak(value): void
  • Set the tweak for sparse creation.

    Parameters

    • value: bigint

    Returns void

  • get prefixManager(): PrefixManager
  • Returns PrefixManager

  • get prefix(): string
  • Returns string

  • get referenceLength(): number
  • Returns number

Methods

  • Get the character set validator for a character set.

    Parameters

    Returns CharacterSetValidator

    Character set validator.

  • Pad an identification key on the left with zeroes for validation purposes. This is done to align an identification key with a position offset for any error message that may be thrown by the reference validator.

    Parameters

    • identificationKey: string

      Identification key.

    • validation: undefined | IdentificationKeyValidation

      Identification key validation parameters.

    Returns string

    Padded identification key.

  • Create a serialized identification key with a reference based on a numeric value and a serial component. The value is converted to a reference of the appropriate length using NUMERIC_CREATOR.

    Parameters

    • value: number

      Numeric value of the references.

    • serialComponent: string

      Serial component.

    • Optionalsparse: boolean

      If true, the value is mapped to a sparse sequence resistant to discovery. Default is false.

    Returns string

    Serialized identification key.

  • Create multiple serialized identification keys with a reference based on a numeric value and multiple serial components. The value is converted to a reference of the appropriate length using NUMERIC_CREATOR.

    Parameters

    • value: number

      Numeric value.

    • serialComponents: Iterable<string, any, any>

      Serial components.

    • Optionalsparse: boolean

      If true, the value is mapped to a sparse sequence resistant to discovery. Default is false.

    Returns IterableIterator<string, any, any>

    Serialized identification keys.

  • Concatenate a base identification key with a serial component.

    Parameters

    • baseIdentificationKey: string

      Base identification key.

    • serialComponent: string

      Serial component.

    Returns string

    Serialized identification key.

  • Concatenate a base identification key with multiple serial components.

    Parameters

    • baseIdentificationKey: string

      Base identification key.

    • serialComponents: Iterable<string, any, any>

      Serial components.

    Returns IterableIterator<string, any, any>

    Serialized identification keys.

  • Parameters

    Returns void

  • Validate the prefix within an identification key.

    Parameters

    • partialIdentificationKey: string

      Partial identification key.

    • OptionalpositionOffset: number

      Position offset within a larger string.

    Returns void

  • Initialize the prefix manager. This method is in lieu of a constructor due to the mixin architecture.

    Parameters

    • prefixManager: PrefixManager

      Prefix manager.

    • prefix: string

      Prefix within prefix manager to use to calculate reference length.

    Returns void

  • Parameters

    • value: number | bigint
    • Optionalsparse: boolean

    Returns string

  • Parameters

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

    Returns IterableIterator<string, any, any>

  • Returns IterableIterator<string, any, any>