MCPcopy
hub / github.com/mongodb/node-mongodb-native / compareDigest

Function compareDigest

src/cmap/auth/scram.ts:347–358  ·  view source on GitHub ↗
(lhs: Uint8Array, rhs: Uint8Array)

Source from the content-addressed store, hash-verified

345}
346
347function compareDigest(lhs: Uint8Array, rhs: Uint8Array) {
348 if (lhs.length !== rhs.length) {
349 return false;
350 }
351
352 let result = 0;
353 for (let i = 0; i < lhs.length; i++) {
354 result |= lhs[i] ^ rhs[i];
355 }
356
357 return result === 0;
358}
359
360export class ScramSHA1 extends ScramSHA {
361 constructor() {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected