1
0
Bifurcation 0
miroir de https://github.com/nicjes/SonicareGenerator.git synchronisé 2025-03-05 16:00:50 +01:00

Pad password with 0 on the left

Cette révision appartient à :
Richard van den Berg 2023-12-27 09:56:37 +01:00
Parent de2626ddd5
révision f4dd371ba9

Voir le fichier

@ -78,7 +78,7 @@
crc = crc | crc16(crc, mfg) << BigInt(16); // Calculate the MFG CRC
crc = ((crc >> BigInt(8)) & BigInt(0x00FF00FF)) | ((crc << BigInt(8)) & BigInt(0xFF00FF00)); // Rotate the bytes
let password = crc.toString(16).toUpperCase().replace(/(..)(..)(..)(..)/g, '$1:$2:$3:$4'); // Format the password
let password = crc.toString(16).padStart(8, '0').toUpperCase().replace(/(..)(..)(..)(..)/g, '$1:$2:$3:$4'); // Format the password
return password;
}