SHA-256

The SHA-256 message digest algorithm produces a 256-bit digest. The algorithm is described in FIPS PUB 180-1. Instances of this algorithm cannot be cloned.

To create a SHA-256 message digest for the message “hello world”:

MessageDigest sha256 = MessageDigest.getInstance(“SHA-256”, “SAFENET”);
byte[] digest = sha256.digest(“hello world”.getBytes());