| … | … | @@ -45,3 +45,8 @@ export function verifyLabel (label, labelerDidKey) { |
| 45 | 45 | if (!label || !label.sig) return false |
| 46 | 46 | return verifySig(labelSigningBytes(label), label.sig, labelerDidKey) |
| 47 | 47 | } |
| 48 | ||
| 49 | // Wire codec for a full (signed) label — one block of a label feed. `sig` (bytes) round-trips as | |
| 50 | // DAG-CBOR bytes. Distinct from labelSigningBytes (which strips sig for the signature domain). | |
| 51 | export function encodeLabel (label) { return dagCbor.encode(label) } | |
| 52 | export function decodeLabel (bytes) { return dagCbor.decode(bytes) } |