Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Implemented by

Index

Constructors

Methods

  • doubleHashing(n: number, hashA: number, hashB: number, size: number): number
  • Apply enhanced Double Hashing to produce a n-hash

    see

    http://peterd.org/pcd-diss.pdf s6.5.4

    memberof

    Hashing

    author

    Thomas Minier

    author

    Arnaud Grall

    Parameters

    • n: number

      The indice of the hash function we want to produce

    • hashA: number

      The result of the first hash function applied to a value.

    • hashB: number

      The result of the second hash function applied to a value.

    • size: number

      The size of the datastructures associated to the hash context (ex: the size of a Bloom Filter)

    Returns number

    The result of hash_n applied to a value.

  • Generate a set of distinct indexes on interval [0, size) using the double hashing technique For generating efficiently distinct indexes we re-hash after detecting a cycle by changing slightly the seed. It has the effect of generating faster distinct indexes without loosing entirely the utility of the double hashing. For small number of indexes it will work perfectly. For a number close to the size, and size very large Advise: do not generate size indexes for a large interval. In practice, size should be equal to the number of hash functions used and is often low.

    author

    Arnaud Grall

    author

    Simon Woolf (SimonWoolf)

    Parameters

    • element: <internal>.HashableInput

      The element to hash

    • size: number

      the range on which we can generate an index [0, size) = size

    • number: number

      The number of indexes desired

    • Optional seed: number

      The seed used

    Returns number[]

    Array

  • Generate N indexes on range [0, size) It uses the double hashing technique to generate the indexes. It hash twice the value only once before generating the indexes. Warning: you can have a lot of modulo collisions.

    Parameters

    • element: <internal>.HashableInput

      The element to hash

    • size: number

      The range on which we can generate the index, exclusive

    • hashCount: number

      The number of indexes we want

    • Optional seed: number

    Returns number[]

    An array of indexes on range [0, size)

  • Hash an item as an unsigned int

    author

    Arnaud Grall

    Parameters

    • elem: <internal>.HashableInput

      Element to hash

    • Optional seed: number

      The hash seed. If its is UINT32 make sure to set the length to 32

    Returns number

    The hash value as an unsigned int

  • Hash an item and return its number and HEX string representation

    author

    Arnaud Grall

    Parameters

    • elem: <internal>.HashableInput

      Element to hash

    • Optional seed: number

      The hash seed. If its is UINT32 make sure to set the length to 32

    Returns { int: number; string: string }

    The item hased as an int and a string

    • int: number
    • string: string
  • (64-bits only) Hash a value into two values (in hex or integer format)

    author

    Arnaud Grall & Thomas Minier

    Parameters

    Returns TwoHashes

    The results of the hash functions applied to the value (in hex or integer)

  • internal

    Hash an element of type HashableInput into {@link Number} Can be overrided as long as you return a value of type {@link Number} Don't forget to use the seed when hashing, otherwise if some kind of randomness is in the process you may have inconsistent behaviors between 2 runs.

    Parameters

    Returns number

    A 64bits floating point {@link Number}

Generated using TypeDoc