mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
fixes for sync
This commit is contained in:
@@ -34,11 +34,18 @@ function fromBase64(encodedText) {
|
||||
return Buffer.from(encodedText, 'base64');
|
||||
}
|
||||
|
||||
function hmac(secret, value) {
|
||||
const hmac = crypto.createHmac('sha256', Buffer.from(secret.toString(), 'ASCII'));
|
||||
hmac.update(value.toString());
|
||||
return hmac.digest('base64');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
randomSecureToken,
|
||||
randomString,
|
||||
nowTimestamp,
|
||||
newNoteId,
|
||||
toBase64,
|
||||
fromBase64
|
||||
fromBase64,
|
||||
hmac
|
||||
};
|
||||
Reference in New Issue
Block a user