From 45adae94f6a8f557b8382b15ac5f7a1d9db11245 Mon Sep 17 00:00:00 2001 From: Johannes Date: Wed, 8 Jan 2025 09:46:54 +0100 Subject: [PATCH] fix `hash.ts` typings --- src/vs/base/common/hash.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vs/base/common/hash.ts b/src/vs/base/common/hash.ts index 5ab5846682b88..edaaf2b4f0ee4 100644 --- a/src/vs/base/common/hash.ts +++ b/src/vs/base/common/hash.ts @@ -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; + }; +}; + /** 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