From ff4ad75aba07a1b4577a29565dab3166c19c7412 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 4 Mar 2020 09:07:04 +0100 Subject: [PATCH] fix layer breaker --- src/vs/base/common/uuid.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/vs/base/common/uuid.ts b/src/vs/base/common/uuid.ts index 680c70a5132..57d9db69de1 100644 --- a/src/vs/base/common/uuid.ts +++ b/src/vs/base/common/uuid.ts @@ -17,14 +17,14 @@ for (let i = 0; i < 256; i++) { _hex.push(i.toString(16).padStart(2, '0')); } -const _fillRandomValues = typeof crypto === 'object' - ? crypto.getRandomValues.bind(crypto) - : function (bucket: Uint8Array): Uint8Array { // todo@jrieken node nodejs use `crypto#randomBytes`, see: https://nodejs.org/docs/latest/api/crypto.html#crypto_crypto_randombytes_size_callback - for (let i = 0; i < bucket.length; i++) { - bucket[i] = Math.floor(Math.random() * 256); - } - return bucket; - }; +// todo@joh node nodejs use `crypto#randomBytes`, see: https://nodejs.org/docs/latest/api/crypto.html#crypto_crypto_randombytes_size_callback +// todo@joh use browser-crypto +const _fillRandomValues = function (bucket: Uint8Array): Uint8Array { + for (let i = 0; i < bucket.length; i++) { + bucket[i] = Math.floor(Math.random() * 256); + } + return bucket; +}; export function generateUuid(): string { // get data