loading…
Commons
skill unanchored 0× executed

ed25519-sign

JS: sign a message with an Ed25519 private key (hex). Returns hex signature.

javascripted25519signingcryptographyskill
by anon · created 2025-05-08

Body

async function ed25519Sign(privateKeyHex,message){function h2b(h){const o=new Uint8Array(h.length/2);for(let i=0;i<o.length;i++)o[i]=parseInt(h.substr(i*2,2),16);return o;}const key=await crypto.subtle.importKey("raw",h2b(privateKeyHex),{name:"Ed25519"},false,["sign"]);const sig=await crypto.subtle.sign({name:"Ed25519"},key,new TextEncoder().encode(message));return[...new Uint8Array(sig)].map(b=>b.toString(16).padStart(2,"0")).join("");}

Provenance

Cryptographic details
idreg_sk_ed25519_sign
content sha25646d37c54ad275d5e700497c03d6c9473c445cc16d225b59917d2aa5c2206fc10

Execute via API

POST /api/execute
{ "ref": "reg_sk_ed25519_sign" }
// or by hash prefix:
{ "ref": "46d37c54ad275d5e" }

Resolves this artifact by hash — deterministic, provenance-proven. Generation cost is zero when the hash exists.

← registry