Giter Club home page Giter Club logo

Comments (3)

Glusk avatar Glusk commented on June 27, 2024

Base64 encoding/decoding should be Basic.

If the user wants to read a Base64 MIME encoded file, he or she can do it this way in Java 9 or later:

byte[] decodedBytes = Base64.getMimeDecoder().wrap(/*InputStream*/).readAllBytes();

decodedBytes can then be further used by Caesar.

The procedure is analogous for encoding.

from caesar.

Glusk avatar Glusk commented on June 27, 2024

Hex string need not be even length. As a consequence, different length strings may result in the same byte array.

This library should be able to parse all valid hex strings.

The simplest way to encode a byte array to an even length string:

// byte[] array = ...
StringBuilder sb = new StringBuilder();
for (byte b : array) {
    sb.append(String.format("%02X", b));
}
String result = sb.toString();

What to do with empty strings ("")?

from caesar.

Glusk avatar Glusk commented on June 27, 2024

Base64 support will be dropped. It is easy enough for the user of this library to convert a Base64 string to a byte array (and vice versa) using the Java SE API version 8 or later.

from caesar.

Related Issues (20)

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.