Обновить HEADER, теги CORE и конфигурацию основного сервера

This commit is contained in:
AidarKC
2026-12-04 00:12:50 +03:00
parent cc010a8eea
commit 3c91014469
40 changed files with 526 additions and 103 deletions
+5 -6
View File
@@ -544,15 +544,14 @@ function extractContactsFromDialogs(dialogs) {
return out;
}
export const HEADER_VERSION = 1;
// Временное значение до утверждения лицензии проекта.
export const HEADER_DEFAULT_LICENSE = '';
export const HEADER_VERSION = 2;
export const HEADER_DEFAULT_LICENSE = 'CC0-1.0';
function makeHeaderBodyBytes({ login, initialBlockchainKey32, license = '', accountType = 1, previousAccounts = [] }) {
function makeHeaderBodyBytes({ login, initialBlockchainKey32, license = 'CC0-1.0', accountType = 1, previousAccounts = [] }) {
const cleanLogin = String(login || '').trim();
const loginBytes = utf8Bytes(cleanLogin);
const licenseBytes = utf8Bytes(license);
if (licenseBytes.length > 255) throw new Error('HEADER license must be 0..255 UTF-8 bytes');
if (licenseBytes.length > 65535) throw new Error('HEADER license must be 0..65535 UTF-8 bytes');
const keyBytes = initialBlockchainKey32 instanceof Uint8Array
? initialBlockchainKey32
: new Uint8Array(initialBlockchainKey32 || []);
@@ -574,7 +573,7 @@ function makeHeaderBodyBytes({ login, initialBlockchainKey32, license = '', acco
int8Byte(loginBytes.length),
loginBytes,
identityBytes,
int8Byte(licenseBytes.length),
Uint8Array.of(licenseBytes.length >> 8, licenseBytes.length & 255),
licenseBytes,
keyBytes,
);