mirror of https://codeberg.org/pzp/pzp-db.git
tweaks
This commit is contained in:
parent
1f53758fe0
commit
b4178b7420
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue