Skip to content

Commit ecf515f

Browse files
committed
Add Multibase.provided() static method fix #93
1 parent ece20f6 commit ecf515f

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/main/java/com/apicatalog/multibase/Multibase.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,25 @@ public class Multibase {
7878
Base58::decode,
7979
Base58::encode);
8080

81+
protected static final Multibase[] ALL = new Multibase[] {
82+
Multibase.BASE_58_BTC,
83+
Multibase.BASE_64,
84+
Multibase.BASE_64_PAD,
85+
Multibase.BASE_64_URL,
86+
Multibase.BASE_64_URL_PAD,
87+
Multibase.BASE_32,
88+
Multibase.BASE_32_UPPER,
89+
Multibase.BASE_32_PAD,
90+
Multibase.BASE_32_PAD_UPPER,
91+
Multibase.BASE_32_HEX,
92+
Multibase.BASE_32_HEX_UPPER,
93+
Multibase.BASE_32_HEX_PAD,
94+
Multibase.BASE_32_HEX_PAD_UPPER,
95+
Multibase.BASE_16,
96+
Multibase.BASE_16_UPPER,
97+
Multibase.BASE_2
98+
};
99+
81100
protected final String name;
82101

83102
protected final char prefix;
@@ -216,4 +235,8 @@ public boolean equals(Object obj) {
216235
public String toString() {
217236
return "Multibase [prefix=" + prefix + ", length=" + length + "]";
218237
}
238+
239+
public static Multibase[] provided() {
240+
return ALL;
241+
}
219242
}

0 commit comments

Comments
 (0)