MCPcopy Index your code
hub / github.com/parse-community/parse-server / randomHexString

Function randomHexString

src/cryptoUtils.js:6–14  ·  view source on GitHub ↗
(size: number)

Source from the content-addressed store, hash-verified

4
5// Returns a new random hex string of the given even size.
6export function randomHexString(size: number): string {
7 if (size === 0) {
8 throw new Error('Zero-length randomHexString is useless.');
9 }
10 if (size % 2 !== 0) {
11 throw new Error('randomHexString size must be divisible by 2.');
12 }
13 return randomBytes(size / 2).toString('hex');
14}
15
16// Returns a new random alphanumeric string of the given size.
17//

Callers 2

createFileMethod · 0.90
newTokenFunction · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected