MCPcopy
hub / github.com/prisma/prisma / random

Method random

helpers/compile/plugins/fill-plugin/fillers/decimal-small.ts:8–16  ·  view source on GitHub ↗
(sd = 20)

Source from the content-addressed store, hash-verified

6 }
7
8 static random(sd = 20): Decimal {
9 if (TARGET_BUILD_TYPE === 'wasm-compiler-edge') {
10 const bytes = globalThis.crypto.getRandomValues(new Uint8Array(sd))
11 const result = bytes.reduce((acc, byte) => acc + byte, '')
12 return new DecimalLight(`0.${result.slice(0, sd)}`)
13 } else {
14 throw new Error('Not implemented for Node.js yet')
15 }
16 }
17}
18
19export default Decimal

Callers 6

createItxScopeIdFunction · 0.80
runBenchmarksFunction · 0.80
pickRandomSubsetFunction · 0.80
tests.tsFile · 0.80
nps.test.tsFile · 0.80
setupFunction · 0.80

Calls 1

sliceMethod · 0.45

Tested by 1

runBenchmarksFunction · 0.64