arithmetic-type/uint64 Home Manual Reference Source

src/big64.js

  1. /**
  2. * Converts a 8-bytes big endian array to a 64-bit integer (also big endian).
  3. *
  4. * @param {Array} a Input big endian array.
  5. * @param {Number} o Offset in the input array.
  6. * @returns {Array} The 64-bit integer.
  7. */
  8. export function big64(a, o) {
  9. return [
  10. (a[o + 0] << 24) | (a[o + 1] << 16) | (a[o + 2] << 8) | a[o + 3],
  11. (a[o + 4] << 24) | (a[o + 5] << 16) | (a[o + 6] << 8) | a[o + 7],
  12. ];
  13. }