Comments (3)
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.
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.
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)
- [Codacy Warning] Bad README.md formatting
- [Codacy Warning] Checkstyle errors in src/test/java
- Make API changes HOT 1
- Hex class doesn't correctly parse negative byte values
- Release script is broken HOT 1
- Bytes should be annotated @FunctionalInterface HOT 1
- Remove jakarta.xml.bind-api dependency
- Link to repo license instead of the template in pom.xml
- Rework README examples HOT 1
- Add a HMAC implementation
- Improve Hashing section in README HOT 1
- Add a method to reverse a byte sequence
- Remove white spaces from argument passed to Hex constructor
- Remove colons (:) from argument passed to Hex constructor
- Add xor function
- Add AbstractBytes
- Tests in HmacTest and HashTest should be simplified
- Add RC4 Cipher HOT 1
- Bug in RC4#update()
- Fix Travis build HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caesar.