Bruce
Search…
Digests

Digester

1
Digester digester(String algorithm);
Copied!
Returns a raw bytes digester for the given algorithm.

Usage Example

1
Digester digester = digester("SHA1");
2
byte[] hash = digester.digest("hello".getBytes(StandardCharsets.UTF_8));
Copied!

Encoding Digester

1
EncodingDigester digester(String algorithm, Encoding encoding);
Copied!
Returns an encoding message digester for the given algorithm.

Usage Example

1
EncodingDigester digester = digester("SHA1", BASE64);
2
String hash = digester.digest("hello");
Copied!

Encoding Digester with Custom Character Set

1
EncodingDigester digester(
2
String algorithm,
3
Encoding encoding,
4
Charset charset
5
);
Copied!
Returns an encoding message digester for the given algorithm and character set.
The character set parameter is used as the default encoding for the input message strings.

Usage Example

1
EncodingDigester digester = digester(
2
"SHA1", BASE64, UTF_16
3
);
4
String hash = digester.digest("hello 👋🏻");
Copied!
Last modified 4mo ago