1 | // Copyright (c) .NET Foundation. All rights reserved.
|
2 | // Licensed under the MIT License.
|
3 |
|
4 | import * as crypto from 'crypto';
|
5 |
|
6 | export function getRandomHexString(length = 10): string {
|
7 | const buffer: Buffer = crypto.randomBytes(Math.ceil(length / 2));
|
8 | return buffer.toString('hex').slice(0, length);
|
9 | }
|