UNIT TEST PROTOCOL
entropy_size.js
www/js/crypto/entropy_size.js · tests/jest/unit/crypto/entropy_size.test.js
📁
www/js/crypto/
📝 Calcul du nombre de bits/mots d'une entropie hex, gestion des tailles BIP39 (128–256 bits).
20
Tests
20
Passing
0
Skipped
5
Suites
▸
GetBitCount
retourne 128 pour 32 hex chars (128 bits)
pass
retourne 256 pour 64 hex chars (256 bits)
pass
retourne NULL_HEX pour une chaîne non-hex
pass
retourne NULL_HEX pour undefined
pass
▸
GetWordCount
retourne 12 pour 128 bits
pass
retourne 15 pour 160 bits
pass
retourne 18 pour 192 bits
pass
retourne 21 pour 224 bits
pass
retourne 24 pour 256 bits
pass
retourne NULL_WORD_COUNT pour un hex invalide
pass
▸
GetChecksumBitCount
retourne 4 pour 12 mots
pass
retourne 5 pour 15 mots
pass
retourne 8 pour 24 mots
pass
défaut à 4 pour undefined
pass
▸
GetSHA256Substring
retourne 32 chars pour 12 mots
pass
retourne 64 chars pour 24 mots (chaîne complète)
pass
▸
GetExpectedWordCount / GetExpectedByteCount
GetExpectedWordCount(128) → 12
pass
GetExpectedWordCount(256) → 24
pass
GetExpectedByteCount(128) → 16
pass
GetExpectedByteCount(256) → 32
pass