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

Merge pull request #1 from RichieB2B/padding

Pad password with 0 on the left
Cette révision appartient à :
Nico Jeschke 2023-12-27 11:30:21 +01:00 révisé par GitHub
révision 2778fd2c15
Aucune clé n'a été trouvée pour cette signature dans la base de données
ID de la clé GPG: 4AEE18F83AFDEB23

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;
}