SHA256
Обновить pairing устройств и доработать ESP32 UI
This commit is contained in:
@@ -101,6 +101,15 @@ export async function createRequesterPairingMaterial() {
|
||||
};
|
||||
}
|
||||
|
||||
export function normalizePairingShortCode(value, digits = 10) {
|
||||
return String(value || '').replace(/\D+/g, '').slice(0, digits).padStart(digits, '0');
|
||||
}
|
||||
|
||||
export function formatPairingShortCode(value) {
|
||||
const normalized = normalizePairingShortCode(value, 10);
|
||||
return normalized.match(/.{1,2}/g)?.join(' ') || normalized;
|
||||
}
|
||||
|
||||
export async function encryptPairingPayloadForRequester(requesterSessionKey, payload) {
|
||||
const requesterPublicB64 = extractSessionPublicKeyB64(requesterSessionKey);
|
||||
const requesterMontPub = edwardsToMontgomeryPub(base64ToBytes(requesterPublicB64));
|
||||
|
||||
Reference in New Issue
Block a user