SHA256
Обновить pairing устройств и доработать ESP32 UI
This commit is contained in:
@@ -59,6 +59,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 deriveEspPairingPasswordHash(login, password) {
|
||||
const loginLower = String(login || '').trim().toLowerCase();
|
||||
const preimage = `${PAIRING_HASH_VERSION}|${loginLower}|${String(password ?? '')}`;
|
||||
|
||||
Reference in New Issue
Block a user