MCPcopy Create free account
hub / github.com/denoland/std / equals

Function equals

bytes/equals.ts:82–90  ·  view source on GitHub ↗
(a: Uint8Array, b: Uint8Array)

Source from the content-addressed store, hash-verified

80 * ```
81 */
82export function equals(a: Uint8Array, b: Uint8Array): boolean {
83 if (a.length !== b.length) {
84 return false;
85 }
86 return a.length >= THRESHOLD_32_BIT &&
87 (a.byteOffset % 4) === (b.byteOffset % 4)
88 ? equals32Bit(a, b)
89 : equalsNaive(a, b);
90}

Callers 1

equals_test.tsFile · 0.90

Calls 2

equals32BitFunction · 0.85
equalsNaiveFunction · 0.85

Tested by

no test coverage detected