chore: update to version 14.0.11 and align website URLs

This commit is contained in:
2026-01-11 11:34:13 +03:00
parent ef74383349
commit 19c8d69bd8
1499 changed files with 53633 additions and 89 deletions
+15
View File
@@ -0,0 +1,15 @@
import { u8aConcat } from '@pezkuwi/util';
import { naclEncrypt } from '../nacl/index.js';
import { scryptEncode, scryptToU8a } from '../scrypt/index.js';
import { jsonEncryptFormat } from './encryptFormat.js';
export function jsonEncrypt(data, contentType, passphrase) {
let isEncrypted = false;
let encoded = data;
if (passphrase) {
const { params, password, salt } = scryptEncode(passphrase);
const { encrypted, nonce } = naclEncrypt(encoded, password.subarray(0, 32));
isEncrypted = true;
encoded = u8aConcat(scryptToU8a(salt, params), nonce, encrypted);
}
return jsonEncryptFormat(encoded, contentType, isEncrypted);
}