MCPcopy
hub / github.com/sparkjsdev/spark / constructor

Method constructor

src/dyno/util.ts:220–234  ·  view source on GitHub ↗
({ value }: { value: DynoVal<T> })

Source from the content-addressed store, hash-verified

218 implements HasDynoOut<"uint">
219{
220 constructor({ value }: { value: DynoVal<T> }) {
221 super({
222 inTypes: { value: valType(value) },
223 outTypes: { hash: "uint" },
224 inputs: { value },
225 construct: ({ value }) => {
226 if (!value) {
227 throw new Error("value is required");
228 }
229 let state = new PcgMix({ value: value }).outputs.state;
230 state = new PcgNext({ state }).outputs.state;
231 return new PcgHash({ state }).outputs;
232 },
233 });
234 }
235 dynoOut(): DynoValue<"uint"> {
236 return new DynoOutput(this, "hash");
237 }

Callers

nothing calls this directly

Calls 1

valTypeFunction · 0.90

Tested by

no test coverage detected