Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions client/src/com/aerospike/client/util/Crypto.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import gnu.crypto.util.Base64;

public final class Crypto {
private static final java.util.Base64.Encoder BASE64_ENCODER = java.util.Base64.getEncoder();

/**
* Generate unique server hash value from set name, key type and user defined key.
* The hash function is RIPEMD-160 (a 160 bit hash).
Expand All @@ -48,10 +50,7 @@ public static byte[] decodeBase64(byte[] src, int off, int len) {
return Base64.decode(src, off, len);
}

/**
* Encode bytes into a base64 encoded string.
*/
public static String encodeBase64(byte[] src) {
return Base64.encode(src, 0, src.length, false);
return BASE64_ENCODER.encodeToString(src);
}
}