support compact seedqrs with high ec

This commit is contained in:
Craig Raw 2023-05-15 15:29:18 -05:00
parent fe19c86544
commit b26c5e5218

View file

@ -41,10 +41,12 @@ public class SeedQR {
String qrHex = Utils.bytesToHex(compactSeedQr); String qrHex = Utils.bytesToHex(compactSeedQr);
String seedHex; String seedHex;
if(qrHex.endsWith("0ec")) { if(qrHex.endsWith("0ec11ec11")) {
seedHex = qrHex.substring(3, qrHex.length() - 3); seedHex = qrHex.substring(3, qrHex.length() - 9); //12 word, high EC
} else if(qrHex.endsWith("0ec")) {
seedHex = qrHex.substring(3, qrHex.length() - 3); //12 word, low EC
} else { } else {
seedHex = qrHex.substring(3, qrHex.length() - 1); seedHex = qrHex.substring(3, qrHex.length() - 1); //24 word
} }
byte[] seed = Utils.hexToBytes(seedHex); byte[] seed = Utils.hexToBytes(seedHex);