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

Function random

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

Source from the content-addressed store, hash-verified

189 * @since 2.0.0
190 */
191export const random: <A extends object>(self: A) => number = (self) => {
192 if (!randomHashCache.has(self)) {
193 randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)))
194 }
195 return randomHashCache.get(self)!
196}
197
198/**
199 * Combines two hash values into a single hash value.

Callers 1

hashFunction · 0.70

Calls 4

numberFunction · 0.70
setMethod · 0.65
getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected