We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 778fdb0 commit 7557151Copy full SHA for 7557151
1 file changed
src/main/java/io/ipfs/multibase/Multibase.java
@@ -44,7 +44,8 @@ public enum Base {
44
lookup.put(b.prefix, b);
45
}
46
47
- public static Base lookup(String p) {
+ public static Base lookup(String data) {
48
+ String p = data.substring(0, 1);
49
if (!lookup.containsKey(p))
50
throw new IllegalArgumentException("Unknown Multibase type: " + p);
51
return lookup.get(p);
@@ -93,7 +94,7 @@ public static String encode(Base b, byte[] data) {
93
94
95
96
public static Base encoding(String data) {
- return Base.lookup(data.substring(0, 1));
97
+ return Base.lookup(data);
98
99
100
public static byte[] decode(String data) {
0 commit comments