zig-minisign
v0.1.3
Published
Zig Minisign is a javascript binding of zig-minisign to enable verify minisig signatures on node
Downloads
2
Readme
minizign
Fork of zig-minisign that provides a JS interface to verify minisign signatures.
Example
import 'node:fs/promises'
import { Minizign } from 'minizign'
const minizign = new Minizign()
await minizign.init() // Init must be run to initialize the wasm module
const publicKey = '...' // Base64 encoded public key
const file = await fs.readFile('file')
const signature = await fs.readFile('file.minisig')
const pk = minizign.publicKey(publicKey)
const sig = minizign.signature(signature)
// If the signature fails to verify, an exception will be thrown
pk.verify(sig, file)
// this next part is only needed if minizign will be reused
pk.deinit()
sig.deinit()
Compilation
Wasm modules
Requires the current master
version of Zig.
zig build -Doptimize=ReleaseFast -Dupdate-module
Javascript
npm install
npm build
npm test