|
46 | 46 | * import static org.apache.commons.codec.digest.MessageDigestAlgorithms.SHA_224; |
47 | 47 | * ... |
48 | 48 | * byte [] digest = DigestUtils.digest(SHA_224, dataToDigest); |
| 49 | + * byte [] pommed = DigestUtils.digest(SHA_224, new File("pom.xml")); |
49 | 50 | * </pre> |
50 | 51 | * </code> |
51 | 52 | * @see MessageDigestAlgorithms |
@@ -358,20 +359,6 @@ public static byte[] md2(final ByteBuffer data) { |
358 | 359 | return digest(getMd2Digest(), data); |
359 | 360 | } |
360 | 361 |
|
361 | | - /** |
362 | | - * Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>. |
363 | | - * |
364 | | - * @param data |
365 | | - * Data to digest |
366 | | - * @return MD2 digest |
367 | | - * @throws IOException |
368 | | - * On error reading from the stream |
369 | | - * @since 1.11 |
370 | | - */ |
371 | | - public static byte[] md2(final File data) throws IOException { |
372 | | - return digest(getMd2Digest(), data); |
373 | | - } |
374 | | - |
375 | 362 | /** |
376 | 363 | * Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>. |
377 | 364 | * |
@@ -422,20 +409,6 @@ public static String md2Hex(final ByteBuffer data) { |
422 | 409 | return Hex.encodeHexString(md2(data)); |
423 | 410 | } |
424 | 411 |
|
425 | | - /** |
426 | | - * Calculates the MD2 digest and returns the value as a 32 character hex string. |
427 | | - * |
428 | | - * @param data |
429 | | - * Data to digest |
430 | | - * @return MD2 digest as a hex string |
431 | | - * @throws IOException |
432 | | - * On error reading from the stream |
433 | | - * @since 1.11 |
434 | | - */ |
435 | | - public static String md2Hex(final File data) throws IOException { |
436 | | - return Hex.encodeHexString(md2(data)); |
437 | | - } |
438 | | - |
439 | 412 | /** |
440 | 413 | * Calculates the MD2 digest and returns the value as a 32 character hex string. |
441 | 414 | * |
@@ -485,20 +458,6 @@ public static byte[] md5(final ByteBuffer data) { |
485 | 458 | return digest(getMd5Digest(), data); |
486 | 459 | } |
487 | 460 |
|
488 | | - /** |
489 | | - * Calculates the MD5 digest and returns the value as a 16 element <code>byte[]</code>. |
490 | | - * |
491 | | - * @param data |
492 | | - * Data to digest |
493 | | - * @return MD5 digest |
494 | | - * @throws IOException |
495 | | - * On error reading from the stream |
496 | | - * @since 1.11 |
497 | | - */ |
498 | | - public static byte[] md5(final File data) throws IOException { |
499 | | - return digest(getMd5Digest(), data); |
500 | | - } |
501 | | - |
502 | 461 | /** |
503 | 462 | * Calculates the MD5 digest and returns the value as a 16 element <code>byte[]</code>. |
504 | 463 | * |
@@ -547,20 +506,6 @@ public static String md5Hex(final ByteBuffer data) { |
547 | 506 | return Hex.encodeHexString(md5(data)); |
548 | 507 | } |
549 | 508 |
|
550 | | - /** |
551 | | - * Calculates the MD5 digest and returns the value as a 32 character hex string. |
552 | | - * |
553 | | - * @param data |
554 | | - * Data to digest |
555 | | - * @return MD5 digest as a hex string |
556 | | - * @throws IOException |
557 | | - * On error reading from the stream |
558 | | - * @since 1.11 |
559 | | - */ |
560 | | - public static String md5Hex(final File data) throws IOException { |
561 | | - return Hex.encodeHexString(md5(data)); |
562 | | - } |
563 | | - |
564 | 509 | /** |
565 | 510 | * Calculates the MD5 digest and returns the value as a 32 character hex string. |
566 | 511 | * |
@@ -652,20 +597,6 @@ public static byte[] sha1(final ByteBuffer data) { |
652 | 597 | return digest(getSha1Digest(), data); |
653 | 598 | } |
654 | 599 |
|
655 | | - /** |
656 | | - * Calculates the SHA-1 digest and returns the value as a <code>byte[]</code>. |
657 | | - * |
658 | | - * @param data |
659 | | - * Data to digest |
660 | | - * @return SHA-1 digest |
661 | | - * @throws IOException |
662 | | - * On error reading from the stream |
663 | | - * @since 1.11 |
664 | | - */ |
665 | | - public static byte[] sha1(final File data) throws IOException { |
666 | | - return digest(getSha1Digest(), data); |
667 | | - } |
668 | | - |
669 | 600 | /** |
670 | 601 | * Calculates the SHA-1 digest and returns the value as a <code>byte[]</code>. |
671 | 602 | * |
@@ -715,20 +646,6 @@ public static String sha1Hex(final ByteBuffer data) { |
715 | 646 | return Hex.encodeHexString(sha1(data)); |
716 | 647 | } |
717 | 648 |
|
718 | | - /** |
719 | | - * Calculates the SHA-1 digest and returns the value as a hex string. |
720 | | - * |
721 | | - * @param data |
722 | | - * Data to digest |
723 | | - * @return SHA-1 digest as a hex string |
724 | | - * @throws IOException |
725 | | - * On error reading from the stream |
726 | | - * @since 1.11 |
727 | | - */ |
728 | | - public static String sha1Hex(final File data) throws IOException { |
729 | | - return Hex.encodeHexString(sha1(data)); |
730 | | - } |
731 | | - |
732 | 649 | /** |
733 | 650 | * Calculates the SHA-1 digest and returns the value as a hex string. |
734 | 651 | * |
@@ -782,23 +699,6 @@ public static byte[] sha256(final ByteBuffer data) { |
782 | 699 | return digest(getSha256Digest(), data); |
783 | 700 | } |
784 | 701 |
|
785 | | - /** |
786 | | - * Calculates the SHA-256 digest and returns the value as a <code>byte[]</code>. |
787 | | - * <p> |
788 | | - * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. |
789 | | - * </p> |
790 | | - * |
791 | | - * @param data |
792 | | - * File to digest |
793 | | - * @return SHA-256 digest |
794 | | - * @throws IOException |
795 | | - * On error reading from the stream |
796 | | - * @since 1.11 |
797 | | - */ |
798 | | - public static byte[] sha256(final File data) throws IOException { |
799 | | - return digest(getSha256Digest(), data); |
800 | | - } |
801 | | - |
802 | 702 | /** |
803 | 703 | * Calculates the SHA-256 digest and returns the value as a <code>byte[]</code>. |
804 | 704 | * <p> |
@@ -858,23 +758,6 @@ public static String sha256Hex(final ByteBuffer data) { |
858 | 758 | return Hex.encodeHexString(sha256(data)); |
859 | 759 | } |
860 | 760 |
|
861 | | - /** |
862 | | - * Calculates the SHA-256 digest and returns the value as a hex string. |
863 | | - * <p> |
864 | | - * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. |
865 | | - * </p> |
866 | | - * |
867 | | - * @param data |
868 | | - * Data to digest |
869 | | - * @return SHA-256 digest as a hex string |
870 | | - * @throws IOException |
871 | | - * On error reading from the stream |
872 | | - * @since 1.11 |
873 | | - */ |
874 | | - public static String sha256Hex(final File data) throws IOException { |
875 | | - return Hex.encodeHexString(sha256(data)); |
876 | | - } |
877 | | - |
878 | 761 | /** |
879 | 762 | * Calculates the SHA-256 digest and returns the value as a hex string. |
880 | 763 | * <p> |
@@ -934,23 +817,6 @@ public static byte[] sha384(final ByteBuffer data) { |
934 | 817 | return digest(getSha384Digest(), data); |
935 | 818 | } |
936 | 819 |
|
937 | | - /** |
938 | | - * Calculates the SHA-384 digest and returns the value as a <code>byte[]</code>. |
939 | | - * <p> |
940 | | - * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. |
941 | | - * </p> |
942 | | - * |
943 | | - * @param data |
944 | | - * File to digest |
945 | | - * @return SHA-384 digest |
946 | | - * @throws IOException |
947 | | - * On error reading from the stream |
948 | | - * @since 1.11 |
949 | | - */ |
950 | | - public static byte[] sha384(final File data) throws IOException { |
951 | | - return digest(getSha384Digest(), data); |
952 | | - } |
953 | | - |
954 | 820 | /** |
955 | 821 | * Calculates the SHA-384 digest and returns the value as a <code>byte[]</code>. |
956 | 822 | * <p> |
@@ -1010,23 +876,6 @@ public static String sha384Hex(final ByteBuffer data) { |
1010 | 876 | return Hex.encodeHexString(sha384(data)); |
1011 | 877 | } |
1012 | 878 |
|
1013 | | - /** |
1014 | | - * Calculates the SHA-384 digest and returns the value as a hex string. |
1015 | | - * <p> |
1016 | | - * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. |
1017 | | - * </p> |
1018 | | - * |
1019 | | - * @param data |
1020 | | - * Data to digest |
1021 | | - * @return SHA-384 digest as a hex string |
1022 | | - * @throws IOException |
1023 | | - * On error reading from the stream |
1024 | | - * @since 1.11 |
1025 | | - */ |
1026 | | - public static String sha384Hex(final File data) throws IOException { |
1027 | | - return Hex.encodeHexString(sha384(data)); |
1028 | | - } |
1029 | | - |
1030 | 879 | /** |
1031 | 880 | * Calculates the SHA-384 digest and returns the value as a hex string. |
1032 | 881 | * <p> |
@@ -1086,23 +935,6 @@ public static byte[] sha512(final ByteBuffer data) { |
1086 | 935 | return digest(getSha512Digest(), data); |
1087 | 936 | } |
1088 | 937 |
|
1089 | | - /** |
1090 | | - * Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>. |
1091 | | - * <p> |
1092 | | - * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. |
1093 | | - * </p> |
1094 | | - * |
1095 | | - * @param data |
1096 | | - * File to digest |
1097 | | - * @return SHA-512 digest |
1098 | | - * @throws IOException |
1099 | | - * On error reading from the stream |
1100 | | - * @since 1.11 |
1101 | | - */ |
1102 | | - public static byte[] sha512(final File data) throws IOException { |
1103 | | - return digest(getSha512Digest(), data); |
1104 | | - } |
1105 | | - |
1106 | 938 | /** |
1107 | 939 | * Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>. |
1108 | 940 | * <p> |
@@ -1162,23 +994,6 @@ public static String sha512Hex(final ByteBuffer data) { |
1162 | 994 | return Hex.encodeHexString(sha512(data)); |
1163 | 995 | } |
1164 | 996 |
|
1165 | | - /** |
1166 | | - * Calculates the SHA-512 digest and returns the value as a hex string. |
1167 | | - * <p> |
1168 | | - * Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0. |
1169 | | - * </p> |
1170 | | - * |
1171 | | - * @param data |
1172 | | - * File to digest |
1173 | | - * @return SHA-512 digest as a hex string |
1174 | | - * @throws IOException |
1175 | | - * On error reading from the stream |
1176 | | - * @since 1.11 |
1177 | | - */ |
1178 | | - public static String sha512Hex(File data) throws IOException { |
1179 | | - return Hex.encodeHexString(sha512(data)); |
1180 | | - } |
1181 | | - |
1182 | 997 | /** |
1183 | 998 | * Calculates the SHA-512 digest and returns the value as a hex string. |
1184 | 999 | * <p> |
|
0 commit comments