Code Monkey home page Code Monkey logo

base47's Introduction

Base₄₇

A Base₄₇ encoder/decoder that uses emojis as its character set

What? 🤔

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.

Usage 🙄

Include it as a gradle submodule

dependencies {
    compile project(':library')
}

Encode

Kotlin

val testString = "Hello World!!!"

val encodedTestString = Base47.encode(testString.getBytes())
...

Java

String testString = "Hello World!!!";

String encodedTestString = Base47.encode(testString.getBytes());
...

Decode

Kotlin

...
val decodedTestStringBytes = Base47.decode(encodedTestString)

val decodedTestString = new String(decodedTestStringBytes)

assert(decodedTestString == testString)

Java

...
byte[] decodedTestStringBytes = Base47.decode(encodedTestString);

String decodedTestString = new String(decodedTestStringBytes);

assert decodedTestString.equals(testString);

License

Base47 is available under the MIT license. See the LICENSE file for more information.

base47's People

Contributors

anthonycr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

base47's Issues

Leading 0's are lost

Given an array of bytes, if any of the leading bytes are all zeroed, the zeros are lost. A potential solution is to prepend a non zero byte to all byte arrays to avoid the bytes being chopped down.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.