A Base₄₇ encoder/decoder that uses emojis as its character set
This is a silly base encoding algorithm written in Kotlin. It purposefully uses an inefficient base to encode to, base 47, and also uses a non-traditional character set. The character set used is a subset of unicode emojis, most of the animal emojis.
Include it as a gradle submodule
dependencies {
compile project(':library')
}
val testString = "Hello World!!!"
val encodedTestString = Base47.encode(testString.getBytes())
...
String testString = "Hello World!!!";
String encodedTestString = Base47.encode(testString.getBytes());
...
...
val decodedTestStringBytes = Base47.decode(encodedTestString)
val decodedTestString = new String(decodedTestStringBytes)
assert(decodedTestString == testString)
...
byte[] decodedTestStringBytes = Base47.decode(encodedTestString);
String decodedTestString = new String(decodedTestStringBytes);
assert decodedTestString.equals(testString);
Base47
is available under the MIT license. See the LICENSE file for more information.