busbey commented on a change in pull request #2539:
URL: https://github.com/apache/hbase/pull/2539#discussion_r520006189



##########
File path: 
hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/Encryption.java
##########
@@ -215,7 +215,7 @@ public static boolean 
failOnHashAlgorithmMismatch(Configuration conf) {
    * Return the MD5 digest of the concatenation of the supplied arguments.
    */
   public static byte[] hash128(String... args) {
-    return hashWithAlg("MD5", args);
+    return hashWithAlg("MD5", Bytes.toByteArrays(args));

Review comment:
       the method `hashWithAlg` needs a vararg array of byte arrays to operate 
on. This call here is coercing the vararg array of Strings into an array of 
byte arrays. AFAIK it's needed.

##########
File path: 
hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/Encryption.java
##########
@@ -229,7 +229,7 @@ public static boolean 
failOnHashAlgorithmMismatch(Configuration conf) {
    * Return the SHA-256 digest of the concatenation of the supplied arguments.
    */
   public static byte[] hash256(String... args) {
-    return hashWithAlg("SHA-256", args);
+    return hashWithAlg("SHA-256", Bytes.toByteArrays(args));

Review comment:
       the method `hashWithAlg` needs a vararg array of byte arrays to operate 
on. This call here is coercing the vararg array of Strings into an array of 
byte arrays. AFAIK it's needed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to