1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-26 17:43:22 +00:00

[PM-31406] fix: TypeScript 5.9 type compatibility fixes for audit.service (#19195)

* fix: TypeScript 5.9 type compatibility fixes for audit.service

Add explicit `as BufferSource` casts and `Uint8Array` wrapping to satisfy
stricter type checking in TypeScript 5.9. Non-functional changes.

* Add non-null assertion
This commit is contained in:
Bernd Schoolmann
2026-02-25 17:46:13 +01:00
committed by GitHub
parent cf7f9cfc7e
commit 4024d34df8

View File

@@ -55,7 +55,7 @@ export class AuditService implements AuditServiceAbstraction {
*/
protected async fetchLeakedPasswordCount(password: string): Promise<number> {
const hashBytes = await this.cryptoFunctionService.hash(password, "sha1");
const hash = Utils.fromBufferToHex(hashBytes).toUpperCase();
const hash = Utils.fromArrayToHex(hashBytes)!.toUpperCase();
const hashStart = hash.substr(0, 5);
const hashEnding = hash.substr(5);