class B64
extends java.lang.Object
TODO: Can Base64 be reused?
This class is immutable and thread-safe.
Modifier and Type | Field and Description |
---|---|
(package private) static char[] |
B64T_ARRAY
Table with characters for Base64 transformation.
|
(package private) static java.lang.String |
B64T_STRING
Table with characters for Base64 transformation.
|
Constructor and Description |
---|
B64() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
b64from24bit(byte b2,
byte b1,
byte b0,
int outLen,
java.lang.StringBuilder buffer)
Base64 like conversion of bytes to ASCII chars.
|
(package private) static java.lang.String |
getRandomSalt(int num)
Generates a string of random chars from the B64T set.
|
(package private) static java.lang.String |
getRandomSalt(int num,
java.util.Random random)
Generates a string of random chars from the B64T set.
|
static final java.lang.String B64T_STRING
static final char[] B64T_ARRAY
static void b64from24bit(byte b2, byte b1, byte b0, int outLen, java.lang.StringBuilder buffer)
b2
- A byte from the result.b1
- A byte from the result.b0
- A byte from the result.outLen
- The number of expected output chars.buffer
- Where the output chars is appended to.static java.lang.String getRandomSalt(int num)
The salt is generated with SecureRandom
.
num
- Number of chars to generate.String
.static java.lang.String getRandomSalt(int num, java.util.Random random)
The salt is generated with the Random
provided.
num
- Number of chars to generate.random
- an instance of Random
.String
.