File tree Expand file tree Collapse file tree
src/main/java/io/ipfs/multibase Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package io .ipfs .multibase ;
22
3- import io . ipfs . multibase . binary .* ;
4- import io . ipfs . multibase . binary . Base64 ;
3+ import java . util . Map ;
4+ import java . util . TreeMap ;
55
6- import java .util .*;
6+ import io .ipfs .multibase .binary .Base32 ;
7+ import io .ipfs .multibase .binary .Base64 ;
78
89public class Multibase {
910
@@ -39,7 +40,7 @@ public enum Base {
3940
4041 private static Map <Character , Base > lookup = new TreeMap <>();
4142 static {
42- for (Base b : Base .values ())
43+ for (Base b : Base .values ())
4344 lookup .put (b .prefix , b );
4445 }
4546
@@ -52,6 +53,7 @@ public static Base lookup(char p) {
5253
5354 public static String encode (Base b , byte [] data ) {
5455 switch (b ) {
56+ case
5557 case Base58BTC :
5658 return b .prefix + Base58 .encode (data );
5759 case Base16 :
@@ -96,7 +98,7 @@ public static Base encoding(String data) {
9698 }
9799
98100 public static byte [] decode (String data ) {
99- if (data .isEmpty ()) {
101+ if (data .isEmpty ()) {
100102 throw new IllegalArgumentException ("Cannot decode an empty string" );
101103 }
102104 Base b = encoding (data );
You can’t perform that action at this time.
0 commit comments