From e7dabb8884e3062e24b56b4f68c506f14713f7e7 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 24 Mar 2021 13:52:41 +0200 Subject: [PATCH] covert fragments to lowercase for legacy decoding, bump to v1.5.4 --- README.md | 2 +- build.gradle | 2 +- .../java/com/sparrowwallet/hummingbird/LegacyURDecoder.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 32eb48f..1c2beef 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It contains both the classes to represent a UR, and a UR encoder and decoder to Hummingbird is hosted in Maven Central and can be added as a dependency with the following: ``` -implementation('com.sparrowwallet:hummingbird:1.5.3') +implementation('com.sparrowwallet:hummingbird:1.5.4') ``` ## Usage diff --git a/build.gradle b/build.gradle index f3cec5b..3ace00b 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ apply plugin: 'com.bmuschko.nexus' archivesBaseName = 'hummingbird' group 'com.sparrowwallet' -version '1.5.3' +version '1.5.4' repositories { mavenCentral() diff --git a/src/main/java/com/sparrowwallet/hummingbird/LegacyURDecoder.java b/src/main/java/com/sparrowwallet/hummingbird/LegacyURDecoder.java index 51fcf68..2e83c10 100644 --- a/src/main/java/com/sparrowwallet/hummingbird/LegacyURDecoder.java +++ b/src/main/java/com/sparrowwallet/hummingbird/LegacyURDecoder.java @@ -8,7 +8,7 @@ public class LegacyURDecoder { private final Set fragments = new LinkedHashSet<>(); public void receivePart(String fragment) { - fragments.add(fragment); + fragments.add(fragment.toLowerCase()); } public boolean isComplete() { @@ -54,7 +54,7 @@ public class LegacyURDecoder { } //Last component is always fragment payload in both legacy and current - String payload = components[components.length-1]; + String payload = components[components.length-1].toLowerCase(); //BC32 will never contain the following characters if(payload.indexOf('b') > -1 || payload.indexOf('i') > -1 || payload.indexOf('o') > -1) {