MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / schemaFingerprint

Function schemaFingerprint

apps/host-cloudflare/src/db/d1.ts:22–26  ·  view source on GitHub ↗
(statements: readonly string[])

Source from the content-addressed store, hash-verified

20const SCHEMA_FINGERPRINT_ID = "runtime-schema";
21
22const schemaFingerprint = async (statements: readonly string[]): Promise<string> => {
23 const bytes = new TextEncoder().encode(statements.join("\0"));
24 const digest = await crypto.subtle.digest("SHA-256", bytes);
25 return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
26};
27
28const isMissingFingerprintTable = (error: unknown): boolean => {
29 for (let current = error, depth = 0; current != null && depth < 8; depth += 1) {

Callers 1

createD1ExecutorDbFunction · 0.85

Calls 2

encodeMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected