A minimal perfect hash indexing lookup that

Type Parameters

  • ValueType extends number

Implements

Constructors

Accessors

Methods

Constructors

  • Type Parameters

    • ValueType extends number

    Parameters

    • gMap_: Int32Array

      The G mapping (see minimum perfect hashing algorithm) that provides the initial mapping from the first colliding hash function to the secondary disambiguation hash function.

    • keyPrefixSum_: Uint32Array

      The mapping to the actual key buffer in the form of a prefix sum table.

    • slotMap_: Int32Array

      The slots in the hash mapped back to their enum values.

    • keyBlob_: Uint8Array

      The blob of keys indexed by the prefix sum.

    Returns default<ValueType>

Accessors

  • get size(): number
  • Get the number of keys/slots in this.

    Returns number

    The number of keys/slots.

Methods

  • Iterates through this (alias for this.entries() that works with for of loop).

    Returns IterableIterator<[Uint8Array, ValueType]>

    The iterator to iterate through this.

  • Get all the items in this map in the form of a lazy iterator.

    Returns IterableIterator<[Uint8Array, ValueType]>

    The lazy iterator to loop through the entries in the map.

    A key value tuple pair between slot valeus and the key data.

  • Implements the for each idiom on this map.

    Parameters

    • callbackfn: (value: ValueType, key: Uint8Array, map: default<ValueType>) => void

      The callback function to call per element.

    • OptionalthisArg: any

      Extra arg to bind this to callback function.

    Returns void

  • Get the corresponding value in this map for a particular key.

    Parameters

    • buffer: Uint8Array

      The buffer to get the key to match from.

    • Optionaloffset: number

      An optional offset into the buffer (will be 0 if not specified)

    • Optionalend: number

      The end offset in the buffer (non inclusive, will be length if specified.

    Returns undefined | ValueType

    The matching value if the key is in the map, otherwise undefined.

  • Does this map have a particular key.

    Parameters

    • buffer: Uint8Array

      The buffer to get the key to match from.

    • Optionaloffset: number

      An optional offset into the buffer (will be 0 if not specified)

    • Optionalend: number

      The end offset in the buffer (non inclusive, will be length if specified.

    Returns boolean

    True if the key is in the map.

  • Get all the keys in this map in the form of a lazy iterator.

    Returns IterableIterator<Uint8Array>

    The lazy iterator to loop through the keys in the map.

    A key from this map.

  • Get all the values in this map in the form of a lazy iterator.

    Returns IterableIterator<ValueType>

    The lazy iterator to loop through the values in the map.

    A value from this map.