Skip to content

Commit 2b9c06f

Browse files
committed
[CODEC-211] Create enum MessageDigestAlgorithm and deprecate class MessageDigestAlgorithms. Don't need these new File APIs anymore.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1744134 13f79535-47bb-0310-9956-ffa450edef68
1 parent 1e48e15 commit 2b9c06f

1 file changed

Lines changed: 0 additions & 222 deletions

File tree

src/main/java/org/apache/commons/codec/digest/DigestUtils.java

Lines changed: 0 additions & 222 deletions
Original file line numberDiff line numberDiff line change
@@ -292,20 +292,6 @@ public static byte[] md2(final ByteBuffer data) {
292292
return digest(getMd2Digest(), data);
293293
}
294294

295-
/**
296-
* Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>.
297-
*
298-
* @param data
299-
* Data to digest
300-
* @return MD2 digest
301-
* @throws IOException
302-
* On error reading from the stream
303-
* @since 1.11
304-
*/
305-
public static byte[] md2(final File data) throws IOException {
306-
return digest(getMd2Digest(), data);
307-
}
308-
309295
/**
310296
* Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>.
311297
*
@@ -356,20 +342,6 @@ public static String md2Hex(final ByteBuffer data) {
356342
return Hex.encodeHexString(md2(data));
357343
}
358344

359-
/**
360-
* Calculates the MD2 digest and returns the value as a 32 character hex string.
361-
*
362-
* @param data
363-
* Data to digest
364-
* @return MD2 digest as a hex string
365-
* @throws IOException
366-
* On error reading from the stream
367-
* @since 1.11
368-
*/
369-
public static String md2Hex(final File data) throws IOException {
370-
return Hex.encodeHexString(md2(data));
371-
}
372-
373345
/**
374346
* Calculates the MD2 digest and returns the value as a 32 character hex string.
375347
*
@@ -419,20 +391,6 @@ public static byte[] md5(final ByteBuffer data) {
419391
return digest(getMd5Digest(), data);
420392
}
421393

422-
/**
423-
* Calculates the MD5 digest and returns the value as a 16 element <code>byte[]</code>.
424-
*
425-
* @param data
426-
* Data to digest
427-
* @return MD5 digest
428-
* @throws IOException
429-
* On error reading from the stream
430-
* @since 1.11
431-
*/
432-
public static byte[] md5(final File data) throws IOException {
433-
return digest(getMd5Digest(), data);
434-
}
435-
436394
/**
437395
* Calculates the MD5 digest and returns the value as a 16 element <code>byte[]</code>.
438396
*
@@ -481,20 +439,6 @@ public static String md5Hex(final ByteBuffer data) {
481439
return Hex.encodeHexString(md5(data));
482440
}
483441

484-
/**
485-
* Calculates the MD5 digest and returns the value as a 32 character hex string.
486-
*
487-
* @param data
488-
* Data to digest
489-
* @return MD5 digest as a hex string
490-
* @throws IOException
491-
* On error reading from the stream
492-
* @since 1.11
493-
*/
494-
public static String md5Hex(final File data) throws IOException {
495-
return Hex.encodeHexString(md5(data));
496-
}
497-
498442
/**
499443
* Calculates the MD5 digest and returns the value as a 32 character hex string.
500444
*
@@ -586,20 +530,6 @@ public static byte[] sha1(final ByteBuffer data) {
586530
return digest(getSha1Digest(), data);
587531
}
588532

589-
/**
590-
* Calculates the SHA-1 digest and returns the value as a <code>byte[]</code>.
591-
*
592-
* @param data
593-
* Data to digest
594-
* @return SHA-1 digest
595-
* @throws IOException
596-
* On error reading from the stream
597-
* @since 1.11
598-
*/
599-
public static byte[] sha1(final File data) throws IOException {
600-
return digest(getSha1Digest(), data);
601-
}
602-
603533
/**
604534
* Calculates the SHA-1 digest and returns the value as a <code>byte[]</code>.
605535
*
@@ -649,20 +579,6 @@ public static String sha1Hex(final ByteBuffer data) {
649579
return Hex.encodeHexString(sha1(data));
650580
}
651581

652-
/**
653-
* Calculates the SHA-1 digest and returns the value as a hex string.
654-
*
655-
* @param data
656-
* Data to digest
657-
* @return SHA-1 digest as a hex string
658-
* @throws IOException
659-
* On error reading from the stream
660-
* @since 1.11
661-
*/
662-
public static String sha1Hex(final File data) throws IOException {
663-
return Hex.encodeHexString(sha1(data));
664-
}
665-
666582
/**
667583
* Calculates the SHA-1 digest and returns the value as a hex string.
668584
*
@@ -718,24 +634,6 @@ public static byte[] sha224(final ByteBuffer data) {
718634
return digest(getSha224Digest(), data);
719635
}
720636

721-
/**
722-
* Calculates the SHA-224 digest and returns the value as a <code>byte[]</code>.
723-
* <p>
724-
* Throws a <code>RuntimeException</code> on JRE versions prior to 1.8.0.
725-
* </p>
726-
*
727-
* @param data
728-
* File to digest
729-
* @return SHA-224 digest
730-
* @throws IOException
731-
* On error reading from the stream
732-
* @throws IllegalArgumentException thrown on JRE versions prior to 1.8.0.
733-
* @since 1.11
734-
*/
735-
public static byte[] sha224(final File data) throws IOException {
736-
return digest(getSha224Digest(), data);
737-
}
738-
739637
/**
740638
* Calculates the SHA-224 digest and returns the value as a <code>byte[]</code>.
741639
* <p>
@@ -802,24 +700,6 @@ public static String sha224Hex(final ByteBuffer data) {
802700
return Hex.encodeHexString(sha224(data));
803701
}
804702

805-
/**
806-
* Calculates the SHA-224 digest and returns the value as a hex string.
807-
* <p>
808-
* Throws a {@link IllegalArgumentException} on JRE versions prior to 1.8.0.
809-
* </p>
810-
*
811-
* @param data
812-
* Data to digest
813-
* @return SHA-224 digest as a hex string
814-
* @throws IOException
815-
* On error reading from the stream
816-
* @throws IllegalArgumentException thrown on JRE versions prior to 1.8.0.
817-
* @since 1.11
818-
*/
819-
public static String sha224Hex(final File data) throws IOException {
820-
return Hex.encodeHexString(sha224(data));
821-
}
822-
823703
/**
824704
* Calculates the SHA-224 digest and returns the value as a hex string.
825705
* <p>
@@ -881,23 +761,6 @@ public static byte[] sha256(final ByteBuffer data) {
881761
return digest(getSha256Digest(), data);
882762
}
883763

884-
/**
885-
* Calculates the SHA-256 digest and returns the value as a <code>byte[]</code>.
886-
* <p>
887-
* Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0.
888-
* </p>
889-
*
890-
* @param data
891-
* File to digest
892-
* @return SHA-256 digest
893-
* @throws IOException
894-
* On error reading from the stream
895-
* @since 1.11
896-
*/
897-
public static byte[] sha256(final File data) throws IOException {
898-
return digest(getSha256Digest(), data);
899-
}
900-
901764
/**
902765
* Calculates the SHA-256 digest and returns the value as a <code>byte[]</code>.
903766
* <p>
@@ -957,23 +820,6 @@ public static String sha256Hex(final ByteBuffer data) {
957820
return Hex.encodeHexString(sha256(data));
958821
}
959822

960-
/**
961-
* Calculates the SHA-256 digest and returns the value as a hex string.
962-
* <p>
963-
* Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0.
964-
* </p>
965-
*
966-
* @param data
967-
* Data to digest
968-
* @return SHA-256 digest as a hex string
969-
* @throws IOException
970-
* On error reading from the stream
971-
* @since 1.11
972-
*/
973-
public static String sha256Hex(final File data) throws IOException {
974-
return Hex.encodeHexString(sha256(data));
975-
}
976-
977823
/**
978824
* Calculates the SHA-256 digest and returns the value as a hex string.
979825
* <p>
@@ -1033,23 +879,6 @@ public static byte[] sha384(final ByteBuffer data) {
1033879
return digest(getSha384Digest(), data);
1034880
}
1035881

1036-
/**
1037-
* Calculates the SHA-384 digest and returns the value as a <code>byte[]</code>.
1038-
* <p>
1039-
* Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0.
1040-
* </p>
1041-
*
1042-
* @param data
1043-
* File to digest
1044-
* @return SHA-384 digest
1045-
* @throws IOException
1046-
* On error reading from the stream
1047-
* @since 1.11
1048-
*/
1049-
public static byte[] sha384(final File data) throws IOException {
1050-
return digest(getSha384Digest(), data);
1051-
}
1052-
1053882
/**
1054883
* Calculates the SHA-384 digest and returns the value as a <code>byte[]</code>.
1055884
* <p>
@@ -1109,23 +938,6 @@ public static String sha384Hex(final ByteBuffer data) {
1109938
return Hex.encodeHexString(sha384(data));
1110939
}
1111940

1112-
/**
1113-
* Calculates the SHA-384 digest and returns the value as a hex string.
1114-
* <p>
1115-
* Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0.
1116-
* </p>
1117-
*
1118-
* @param data
1119-
* Data to digest
1120-
* @return SHA-384 digest as a hex string
1121-
* @throws IOException
1122-
* On error reading from the stream
1123-
* @since 1.11
1124-
*/
1125-
public static String sha384Hex(final File data) throws IOException {
1126-
return Hex.encodeHexString(sha384(data));
1127-
}
1128-
1129941
/**
1130942
* Calculates the SHA-384 digest and returns the value as a hex string.
1131943
* <p>
@@ -1185,23 +997,6 @@ public static byte[] sha512(final ByteBuffer data) {
1185997
return digest(getSha512Digest(), data);
1186998
}
1187999

1188-
/**
1189-
* Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>.
1190-
* <p>
1191-
* Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0.
1192-
* </p>
1193-
*
1194-
* @param data
1195-
* File to digest
1196-
* @return SHA-512 digest
1197-
* @throws IOException
1198-
* On error reading from the stream
1199-
* @since 1.11
1200-
*/
1201-
public static byte[] sha512(final File data) throws IOException {
1202-
return digest(getSha512Digest(), data);
1203-
}
1204-
12051000
/**
12061001
* Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>.
12071002
* <p>
@@ -1261,23 +1056,6 @@ public static String sha512Hex(final ByteBuffer data) {
12611056
return Hex.encodeHexString(sha512(data));
12621057
}
12631058

1264-
/**
1265-
* Calculates the SHA-512 digest and returns the value as a hex string.
1266-
* <p>
1267-
* Throws a <code>RuntimeException</code> on JRE versions prior to 1.4.0.
1268-
* </p>
1269-
*
1270-
* @param data
1271-
* File to digest
1272-
* @return SHA-512 digest as a hex string
1273-
* @throws IOException
1274-
* On error reading from the stream
1275-
* @since 1.11
1276-
*/
1277-
public static String sha512Hex(File data) throws IOException {
1278-
return Hex.encodeHexString(sha512(data));
1279-
}
1280-
12811059
/**
12821060
* Calculates the SHA-512 digest and returns the value as a hex string.
12831061
* <p>

0 commit comments

Comments
 (0)