MCPcopy Create free account
hub / github.com/dailydotdev/apps / hashSource

Function hashSource

packages/world-kit/src/run.js:25–32  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

23
24/** FNV-1a. Small, synchronous and identical in both hosts, which crypto is not. */
25export function hashSource(source) {
26 let h = 0x811c9dc5;
27 for (let i = 0; i < source.length; i += 1) {
28 h ^= source.charCodeAt(i);
29 h = Math.imul(h, 0x01000193) >>> 0;
30 }
31 return h.toString(16).padStart(8, '0');
32}
33
34const record = (build, ctx, seed) => {
35 const { api, ops } = createRecorder({ ...ctx, seed });

Callers 5

frameForFunction · 0.90
rebuildFileFunction · 0.90
runBuilderFunction · 0.85
runRealmBuilderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected