1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

[PM-6328] Checkmarx - Resolve warnings (#7941)

This commit is contained in:
Oscar Hinton
2024-02-15 22:25:53 +01:00
committed by GitHub
parent c8c1ed42ba
commit 02dde0c0d3
49 changed files with 101 additions and 85 deletions

View File

@@ -139,7 +139,7 @@ export class WebCryptoFunctionService implements CryptoFunctionService {
algorithm: "sha1" | "sha256" | "sha512" | "md5",
): Promise<Uint8Array> {
if (algorithm === "md5") {
const md = algorithm === "md5" ? forge.md.md5.create() : forge.md.sha1.create();
const md = forge.md.md5.create();
const valueBytes = this.toByteString(value);
md.update(valueBytes, "raw");
return Utils.fromByteStringToArray(md.digest().data);