MCPcopy Create free account
hub / github.com/Effect-TS/effect / random

Function random

packages/effect/src/Hash.ts:217–223  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

215 * @since 2.0.0
216 */
217export const random: <A extends object>(self: A) => number = (self) => {
218 let h = randomHashCache.get(self)
219 if (h === undefined) {
220 randomHashCache.set(self, h = optimize((Math.random() * 0x100000000) | 0))
221 }
222 return h
223}
224
225/**
226 * Combines two hash values into a single hash value.

Callers 1

hashFunction · 0.70

Calls 3

optimizeFunction · 0.85
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected