List of utility methods to do SHA256
byte[] | sha256Digest(final InputStream data) sha Digest MessageDigest digest = getSHA256MessageDigest();
updateMessageDigest(digest, data);
return digest.digest();
|
String | sha256Encode(String message) sha Encode return encode("SHA-256", message); |
String | sha256encrypt(String phrase) shaencrypt return generateHash(phrase, "SHA-256"); |
MessageDigest | sha256Hash() sha Hash return MessageDigest.getInstance("SHA-256"); |
byte[] | sha256Hash(byte[] data) Compute the SHA-256 hash of the given byte array MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); return messageDigest.digest(data); |
byte[] | sha256Hash(File file) Calculate the SHA-256 hash for a given file efficiently. FileInputStream in = new FileInputStream(file); return sha256Hash(in); |
String | sha256Hash(final String tohash) sha Hash byte[] b = null; try { b = tohash.getBytes("UTF-8"); MessageDigest sha256 = MessageDigest.getInstance("SHA-256"); b = sha256.digest(b); } catch (UnsupportedEncodingException e) { throw new Error(e); } catch (NoSuchAlgorithmException e) { ... |
String | sha256HashHex(String data) sha Hash Hex return sha256HashHex(data.getBytes());
|
byte[] | SHA256Sum(final @Nonnull byte[] bytes) SHA Sum return sha256.digest(bytes);
|