Package herddb.network
Class HashUtils
- java.lang.Object
-
- herddb.network.HashUtils
-
public class HashUtils extends Object
Utility for Secure hashes
-
-
Constructor Summary
Constructors Constructor Description HashUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringarraytohexstring(byte[] bytes)static Stringmd5(byte[] data)Compute a MD5 hash using Java built-in MessageDigest, and format the result in hex.static Stringmd5(String data)static Stringsha1(byte[] data)Compute a SHA-1 hash using Java built-in MessageDigest, and format the result in hex.static Stringsha1(String data)static Stringsha256(byte[] data)Compute a SHA-256 hash using Java built-in MessageDigest, and format the result in hex.static Stringsha256(String data)
-
-
-
Method Detail
-
sha1
public static String sha1(byte[] data)
Compute a SHA-1 hash using Java built-in MessageDigest, and format the result in hex. Beware that hash-computation is a CPU intensive operation- Parameters:
data-- Returns:
-
sha256
public static String sha256(byte[] data)
Compute a SHA-256 hash using Java built-in MessageDigest, and format the result in hex. Beware that hash-computation is a CPU intensive operation- Parameters:
data-- Returns:
-
md5
public static String md5(byte[] data)
Compute a MD5 hash using Java built-in MessageDigest, and format the result in hex. Beware that hash-computation is a CPU intensive operation- Parameters:
data-- Returns:
-
arraytohexstring
public static String arraytohexstring(byte[] bytes)
-
-