groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danielsun1106 <...@git.apache.org>
Subject [GitHub] groovy pull request #793: GROOVY-8780: Add `sha256` DGM
Date Sat, 08 Sep 2018 05:10:11 GMT
Github user danielsun1106 commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/793#discussion_r216121282
  
    --- Diff: src/main/java/org/codehaus/groovy/runtime/EncodingGroovyMethods.java ---
    @@ -389,6 +390,26 @@ public static String md5(byte[] self) throws NoSuchAlgorithmException
{
             return digest(self, MD5);
         }
     
    +    /**
    +     * Calculate SHA-256 of the CharSequence instance
    +     * @return SHA-256 value
    +     * @throws NoSuchAlgorithmException if SHA-256 algorithm not found
    +     * @since 2.5.0
    +     */
    +    public static String sha256(CharSequence self) throws NoSuchAlgorithmException {
    +        return digest(self, SHA_256);
    +    }
    +
    +    /**
    +     * Calculate SHA-256 of the byte array
    +     * @return SHA-256 value
    +     * @throws NoSuchAlgorithmException if SHA-256 algorithm not found
    +     * @since 2.5.0
    --- End diff --
    
    OK. I'll fix it. Thanks ;-)


---

Mime
View raw message