Added support for macedonian denar
This commit is contained in:
parent
8350ec5ee5
commit
ef608e6466
|
@ -8,4 +8,16 @@ out/
|
||||||
*.iml
|
*.iml
|
||||||
target
|
target
|
||||||
install-libs.sh
|
install-libs.sh
|
||||||
.mvn-repo
|
.mvn-repo
|
||||||
|
*.project
|
||||||
|
*.classpath
|
||||||
|
/settings/
|
||||||
|
/.settings/
|
||||||
|
/.settings/*
|
||||||
|
.settings/
|
||||||
|
.settings/*
|
||||||
|
/bin/
|
||||||
|
/bin/*
|
||||||
|
bin/
|
||||||
|
bin/*
|
||||||
|
bin
|
|
@ -23,6 +23,9 @@ dependencies {
|
||||||
compile(group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25')
|
compile(group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25')
|
||||||
compile(group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25')
|
compile(group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25')
|
||||||
compile(group: 'com.sun.mail', name: 'javax.mail', version: '1.4.7')
|
compile(group: 'com.sun.mail', name: 'javax.mail', version: '1.4.7')
|
||||||
|
compile(group: 'commons-codec', name: 'commons-codec', version: '1.3')
|
||||||
|
|
||||||
|
testCompile (group: 'junit', name: 'junit', version: '4.10')
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
|
|
|
@ -141,7 +141,7 @@ public enum Country {
|
||||||
LT("LT", "LTU", "Lithuania"),
|
LT("LT", "LTU", "Lithuania"),
|
||||||
LU("LU", "LUX", "Luxembourg"),
|
LU("LU", "LUX", "Luxembourg"),
|
||||||
MO("MO", "MAC", "Macao"),
|
MO("MO", "MAC", "Macao"),
|
||||||
MK("MK", "MKD", "Macedonia (the former Yugoslav Republic of)"),
|
MK("MK", "MKD", "Macedonia"),
|
||||||
MG("MG", "MDG", "Madagascar"),
|
MG("MG", "MDG", "Madagascar"),
|
||||||
MW("MW", "MWI", "Malawi"),
|
MW("MW", "MWI", "Malawi"),
|
||||||
MY("MY", "MYS", "Malaysia"),
|
MY("MY", "MYS", "Malaysia"),
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.generalbytes.batm.server.coinutil;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
|
public class Base58Test {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("com.generalbytes.batm.server.coinutil.Base58Test");
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void bitcoinAddressTest() {
|
||||||
|
String address = "35qL43qYwLdKtnR7yMfGNDvzv6WyZ8yT2n";
|
||||||
|
try {
|
||||||
|
Base58.decodeToBigInteger(address);
|
||||||
|
Base58.decodeChecked(address);
|
||||||
|
System.out.println("Address = " + address);
|
||||||
|
Assert.assertNotNull(address);
|
||||||
|
} catch (AddressFormatException e) {
|
||||||
|
log.debug("isAddressValid - address = " + address);
|
||||||
|
Assert.assertTrue(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void bitcoinCashAddressTest() {
|
||||||
|
String address = "qze82zm3uuufcdftffy7auyxav8wyxntxqqcswq5s7";
|
||||||
|
try {
|
||||||
|
Base58.decodeToBigInteger(address);
|
||||||
|
Base58.decodeChecked(address);
|
||||||
|
System.out.println("Address = " + address);
|
||||||
|
Assert.assertNotNull(address);
|
||||||
|
} catch (AddressFormatException e) {
|
||||||
|
log.info("isAddressValid - address = " + address);
|
||||||
|
Assert.assertTrue(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void encodeSimpleString() {
|
||||||
|
String originalInput = "test input";
|
||||||
|
String encodedString = "qze82zm3uuufcdftffy7auyxav8wyxntxqqcswq5s7";
|
||||||
|
byte[] decodedBytes = Base64.getDecoder().decode(encodedString);
|
||||||
|
String decodedString = new String(decodedBytes);
|
||||||
|
Assert.assertNotNull(decodedString);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue