| 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 { |