crc.d.ts 548 B

1234567891011121314151617181920
  1. /**
  2. * Implements crc32 from [IEEE 802.3](https://standards.ieee.org/ieee/802.3/10422/),
  3. * [ISO 3309](https://www.iso.org/standard/8561.html),
  4. * [ISO/IEC 13239:2002](https://www.iso.org/standard/37010.html),
  5. * and others.
  6. *
  7. * ```js
  8. * import { crc32 } from '@exodus/bytes/crc.js'
  9. * ```
  10. *
  11. * @module @exodus/bytes/crc.js
  12. */
  13. /**
  14. * Calculate the CRC-32 of a `Uint8Array`, as an unsigned number.
  15. *
  16. * @param arr - The input bytes
  17. * @returns CRC-32 as an unsigned number from 0 to 2**32-1
  18. */
  19. export function crc32(arr: Uint8Array): number;