Initial vmc CLI
This commit is contained in:
17
scripts/hash-receipt.ts
Normal file
17
scripts/hash-receipt.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { hashBlake3Hex, hashSha256Hex } from "../src/lib/hash.js";
|
||||
import fs from "fs";
|
||||
|
||||
const body = JSON.parse(fs.readFileSync("outputs/receipts/test-receipt.json", "utf8"));
|
||||
const blake3 = hashBlake3Hex(body);
|
||||
const sha256 = hashSha256Hex(body);
|
||||
|
||||
const envelope = {
|
||||
...body,
|
||||
hash_alg: "blake3+sha256",
|
||||
blake3,
|
||||
sha256
|
||||
};
|
||||
|
||||
fs.writeFileSync("outputs/receipts/test-receipt.json", JSON.stringify(envelope, null, 2));
|
||||
console.log("blake3:", blake3);
|
||||
console.log("sha256:", sha256);
|
||||
Reference in New Issue
Block a user