mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 16:57:42 +00:00
Ignore extra spaces and special characters in Recovery Password entry
This commit is contained in:
@@ -76,6 +76,20 @@ class MnemonicCodecTest {
|
||||
assertEquals("0f2ccde528622876b8f16e14db97dafc", result)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `sanitizeAndDecodeAsByteArray with mnemonic with unnecessary spaces`() {
|
||||
val result = codec.sanitizeAndDecodeAsByteArray(" fuming nearby kennel husband dejected pepper jaded because dads goggles tufts tomorrow dejected ").let(Hex::toStringCondensed)
|
||||
|
||||
assertEquals("0f2ccde528622876b8f16e14db97dafc", result)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `sanitizeAndDecodeAsByteArray with mnemonic with special characters`() {
|
||||
val result = codec.sanitizeAndDecodeAsByteArray("...fuming nearby.kennel.husband . dejected pepper jaded because dads goggles tufts tomorrow dejected@").let(Hex::toStringCondensed)
|
||||
|
||||
assertEquals("0f2ccde528622876b8f16e14db97dafc", result)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `decodeMnemonicOrHexAsByteArray with hex`() {
|
||||
val result = codec.decodeMnemonicOrHexAsByteArray("0f2ccde528622876b8f16e14db97dafc").let(Hex::toStringCondensed)
|
||||
|
Reference in New Issue
Block a user