urbanairship-core/src/main/java/com/urbanairship/util/UAStringUtil.java
public static byte[] sha256Digest(String value) {
        if (value == null) {
            return null;
        }

        try {
            MessageDigest digest = MessageDigest.getInstance("SHA-256");
            return digest.digest(value.getBytes("UTF-8"));
        } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
            Logger.error("Failed to encode string: " + value, e);
            return null;
        }
    }
/**
     * Generates the sha256 digest for a given string.
     *
     * @param value The string.
     * @return The sha256 digest for the string, or null if it failed
     * to create the digest.
     */
Generates the sha256 digest for a given string.
@param value The string.
@return The sha256 digest for the string, or null if it failed
to create the digest.
Generates the sha256 digest for a given string . @param value The string . @return The sha256 digest for the string or null if it failed to create the digest .
public static byte[] sha256Digest(String value) {
        if (value == null) {
            return null;
        }
        try {
            MessageDigest digest = MessageDigest.getInstance("SHA-256");
            return digest.digest(value.getBytes("UTF-8"));
        } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
            Logger.error("Failed to encode string: " + value, e);
            return null;
        }
    }
public static byte [ ] sha256Digest ( String value ) { if ( value == null ) { return null ; } try { MessageDigest digest = MessageDigest . getInstance ( "SHA-256" ) ; return digest . digest ( value . getBytes ( "UTF-8" ) ) ; } catch ( NoSuchAlgorithmException | UnsupportedEncodingException e ) { Logger . error ( "Failed to encode string: " + value , e ) ; return null ; } }
Generates the sha256 digest for a given string.
Generates the sha256 digest for a given string .