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

Function number

packages/effect/src/Hash.ts:352–359  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

350 * @since 2.0.0
351 */
352export const number = (n: number) => {
353 const h = n | 0
354 if (h === n) {
355 return optimize(h)
356 }
357 float64.setFloat64(0, n !== n ? NaN : n)
358 return optimize(combineDataFirst(float64.getInt32(0), float64.getInt32(4)))
359}
360
361/**
362 * Computes a hash value for a string using the djb2 algorithm.

Callers 1

hashFunction · 0.70

Calls 1

optimizeFunction · 0.85

Tested by

no test coverage detected