Skip to content

Commit

Permalink
fix hash.ts typings
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Jan 8, 2025
1 parent b0d6d34 commit 45adae9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/vs/base/common/hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ function objectHash(obj: any, initialHashVal: number): number {
}, initialHashVal);
}

// this is shared global between browsers and nodejs
declare const crypto: {
subtle: {
digest(a: string, b: ArrayBufferView): Promise<ArrayBuffer>;
};
};

/** Hashes the input as SHA-1, returning a hex-encoded string. */
export const hashAsync = (input: string | ArrayBufferView | VSBuffer) => {
// Note: I would very much like to expose a streaming interface for hashing
Expand Down

0 comments on commit 45adae9

Please sign in to comment.