@@ -57,17 +57,6 @@ private static byte[] digest(MessageDigest digest, InputStream data) throws IOEx
5757 return digest .digest ();
5858 }
5959
60- /**
61- * Calls {@link StringUtils#getBytesUtf8(String)}
62- *
63- * @param data
64- * the String to encode
65- * @return encoded bytes
66- */
67- private static byte [] getBytesUtf8 (String data ) {
68- return StringUtils .getBytesUtf8 (data );
69- }
70-
7160 /**
7261 * Returns a <code>MessageDigest</code> for the given <code>algorithm</code>.
7362 *
@@ -226,7 +215,7 @@ public static byte[] md2(InputStream data) throws IOException {
226215 * @since 1.7
227216 */
228217 public static byte [] md2 (String data ) {
229- return md2 (getBytesUtf8 (data ));
218+ return md2 (StringUtils . getBytesUtf8 (data ));
230219 }
231220
232221 /**
@@ -300,7 +289,7 @@ public static byte[] md5(InputStream data) throws IOException {
300289 * @return MD5 digest
301290 */
302291 public static byte [] md5 (String data ) {
303- return md5 (getBytesUtf8 (data ));
292+ return md5 (StringUtils . getBytesUtf8 (data ));
304293 }
305294
306295 /**
@@ -415,7 +404,7 @@ public static byte[] sha1(InputStream data) throws IOException {
415404 * @return SHA-1 digest
416405 */
417406 public static byte [] sha1 (String data ) {
418- return sha1 (getBytesUtf8 (data ));
407+ return sha1 (StringUtils . getBytesUtf8 (data ));
419408 }
420409
421410 /**
@@ -500,7 +489,7 @@ public static byte[] sha256(InputStream data) throws IOException {
500489 * @since 1.4
501490 */
502491 public static byte [] sha256 (String data ) {
503- return sha256 (getBytesUtf8 (data ));
492+ return sha256 (StringUtils . getBytesUtf8 (data ));
504493 }
505494
506495 /**
@@ -594,7 +583,7 @@ public static byte[] sha384(InputStream data) throws IOException {
594583 * @since 1.4
595584 */
596585 public static byte [] sha384 (String data ) {
597- return sha384 (getBytesUtf8 (data ));
586+ return sha384 (StringUtils . getBytesUtf8 (data ));
598587 }
599588
600589 /**
@@ -688,7 +677,7 @@ public static byte[] sha512(InputStream data) throws IOException {
688677 * @since 1.4
689678 */
690679 public static byte [] sha512 (String data ) {
691- return sha512 (getBytesUtf8 (data ));
680+ return sha512 (StringUtils . getBytesUtf8 (data ));
692681 }
693682
694683 /**
@@ -806,7 +795,7 @@ public static MessageDigest updateDigest(final MessageDigest messageDigest, byte
806795 * @since 1.7
807796 */
808797 public static MessageDigest updateDigest (final MessageDigest messageDigest , final String valueToDigest ) {
809- messageDigest .update (getBytesUtf8 (valueToDigest ));
798+ messageDigest .update (StringUtils . getBytesUtf8 (valueToDigest ));
810799 return messageDigest ;
811800 }
812801}
0 commit comments