use randomBytes for rnd file name generation, https://github.com/microsoft/vscode/issues/139217

This commit is contained in:
Johannes Rieken
2021-12-16 16:25:48 +01:00
parent 28bf810a25
commit b00e5cdbd0
2 changed files with 5 additions and 4 deletions

View File

@@ -4,11 +4,12 @@
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import * as crypto from 'crypto';
import * as vscode from 'vscode';
import { TestFS } from './memfs';
export function rndName() {
return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 10);
return crypto.randomBytes(8).toString('hex');
}
export const testFs = new TestFS('fake-fs', true);