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
+22
View File
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.encodePair = encodePair;
const util_1 = require("@pezkuwi/util");
const util_crypto_1 = require("@pezkuwi/util-crypto");
const defaults_js_1 = require("./defaults.js");
/**
* Encode a pair with the latest generation format (generation 3)
**/
function encodePair({ publicKey, secretKey }, passphrase) {
if (!secretKey) {
throw new Error('Expected a valid secretKey to be passed to encode');
}
const encoded = (0, util_1.u8aConcat)(defaults_js_1.PAIR_HDR, secretKey, defaults_js_1.PAIR_DIV, publicKey);
if (!passphrase) {
return encoded;
}
// this is only for generation 3 (previous generations are only handled in decoding)
const { params, password, salt } = (0, util_crypto_1.scryptEncode)(passphrase);
const { encrypted, nonce } = (0, util_crypto_1.naclEncrypt)(encoded, password.subarray(0, 32));
return (0, util_1.u8aConcat)((0, util_crypto_1.scryptToU8a)(salt, params), nonce, encrypted);
}