MCPcopy Create free account
hub / github.com/angular/dev-infra / compareBase64Mixed

Function compareBase64Mixed

github-actions/browserstack/set-browserstack-env.js:4582–4595  ·  view source on GitHub ↗
(actualValue, expectedValue)

Source from the content-addressed store, hash-verified

4580 return true;
4581 }
4582 const parsedMetadata = parseMetadata(metadataList);
4583 if (parsedMetadata === "no metadata") {
4584 return true;
4585 }
4586 if (parsedMetadata.length === 0) {
4587 return true;
4588 }
4589 const strongest = getStrongestMetadata(parsedMetadata);
4590 const metadata = filterMetadataListByAlgorithm(parsedMetadata, strongest);
4591 for (const item of metadata) {
4592 const algorithm = item.algo;
4593 const expectedValue = item.hash;
4594 let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64");
4595 if (actualValue[actualValue.length - 1] === "=") {
4596 if (actualValue[actualValue.length - 2] === "=") {
4597 actualValue = actualValue.slice(0, -2);
4598 } else {

Callers 1

bytesMatchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected