Giter Site home page Giter Site logo

base62's Introduction

Base62 license

A Base62 Encoder/Decoder for Java

Getting Started

For Maven-based projects, add the following to your pom.xml file. This dependency is available from the Maven Central repository.

<dependency>
    <groupId>io.seruco.encoding</groupId>
    <artifactId>base62</artifactId>
    <version>0.1.3</version>
</dependency>

Usage

Base62 base62 = Base62.createInstance();

Encoding

final byte[] encoded = base62.encode("Hello World".getBytes());

new String(encoded); // is "73XpUgyMwkGr29M"

Decoding

final byte[] decoded = base62.decode("73XpUgyMwkGr29M".getBytes());

new String(decoded); // is "Hello World"

Character Sets

This library supports two character sets: GMP-style or inverted. The difference between these two is whether the upper case letters come first, 0-9A-Za-z (GMP), or last, 0-9a-zA-Z (inverted).

By default, we prefer the GMP-style character set. If you want to use the inverted character set, simply do this:

Base62 base62 = Base62.createInstanceWithInvertedCharacterSet();

Licensing

This project is licensed under the MIT License.

base62's People

Contributors

seruco avatar

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.