From b4178b742003e5b2aaf52791d193d70d7df60a79 Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Fri, 7 Apr 2023 15:19:26 +0300 Subject: [PATCH] tweaks --- lib/feed-v1/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/feed-v1/index.js b/lib/feed-v1/index.js index 760e783..fec0ec9 100644 --- a/lib/feed-v1/index.js +++ b/lib/feed-v1/index.js @@ -169,6 +169,7 @@ function create(opts) { if ((err = validateContent(msg))) throw err const privateKey = Buffer.from(opts.keys.private, 'base64') + // TODO: add a label prefix to the metadata before signing const metadataBuf = Buffer.from(stringify(msg.metadata), 'utf8') // TODO: when signing, what's the point of a customizable hmac? const sigBuf = ed25519.sign(privateKey, metadataBuf) @@ -187,6 +188,7 @@ function fromPlaintextBuffer(plaintextBuf, msg) { } module.exports = { + getMsgHash, getMsgId, getFeedId, isFeedId, @@ -198,7 +200,4 @@ module.exports = { validateOOO, validateBatch, validateOOOBatch, - - // custom APIs: - getMsgHash, }