Options
All
  • Public
  • Public/Protected
  • All
Menu

A QLDB hash is either a 256 bit number or a special empty hash.

Hierarchy

  • QldbHash

Index

Constructors

constructor

  • new QldbHash(qldbHash: Uint8Array): QldbHash
  • Creates a QldbHash.

    throws

    RangeError When this hash is not the correct hash size.

    Parameters

    • qldbHash: Uint8Array

      The QLDB hash.

    Returns QldbHash

Properties

Private _qldbHash

_qldbHash: Uint8Array

Methods

dot

  • Sort the current hash value and the hash value provided by that, comparing by their signed byte values in little-endian order.

    Parameters

    • that: QldbHash

      The Ion hash of the Ion value to compare.

    Returns QldbHash

    An QldbHash object that contains the concatenated hash values.

equals

getHashSize

  • getHashSize(): number

getQldbHash

  • getQldbHash(): Uint8Array

isEmpty

  • isEmpty(): boolean

Static _concatenate

  • _concatenate(...arrays: Uint8Array[]): Uint8Array
  • Helper method that concatenates two Uint8Array.

    Parameters

    • Rest ...arrays: Uint8Array[]

      List of arrays to concatenate, in the order provided.

    Returns Uint8Array

    The concatenated array.

Static _hashComparator

  • _hashComparator(hash1: Uint8Array, hash2: Uint8Array): number
  • Compares two hashes by their signed byte values in little-endian order.

    throws

    RangeError When the hash is not the correct hash size.

    Parameters

    • hash1: Uint8Array

      The hash value to compare.

    • hash2: Uint8Array

      The hash value to compare.

    Returns number

    Zero if the hash values are equal, otherwise return the difference of the first pair of non-matching bytes.

Static _joinHashesPairwise

  • _joinHashesPairwise(h1: Uint8Array, h2: Uint8Array): Uint8Array
  • Takes two hashes, sorts them, and concatenates them.

    Parameters

    • h1: Uint8Array

      Byte array containing one of the hashes to compare.

    • h2: Uint8Array

      Byte array containing one of the hashes to compare.

    Returns Uint8Array

    The concatenated array of hashes.

Static toQldbHash

  • The QldbHash of an IonValue is just the IonHash of that value.

    Parameters

    • value: any

      The string or Ion value to be converted to Ion hash.

    Returns QldbHash

    A QldbHash object that contains Ion hash.

Generated using TypeDoc