Skip to content

Commit 5d758fa

Browse files
committed
Deprecate SHA APIs in favor of SHA-1 APIs.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1380028 13f79535-47bb-0310-9956-ffa450edef68
1 parent b72d9cb commit 5d758fa

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,9 @@ public static String md5Hex(String data) {
342342
* @param data
343343
* Data to digest
344344
* @return SHA-1 digest
345+
* @deprecated Use {@link #sha1(byte[])}
345346
*/
347+
@Deprecated
346348
public static byte[] sha(byte[] data) {
347349
return getShaDigest().digest(data);
348350
}
@@ -356,7 +358,9 @@ public static byte[] sha(byte[] data) {
356358
* @throws IOException
357359
* On error reading from the stream
358360
* @since 1.4
361+
* @deprecated Use {@link #sha1(InputStream)}
359362
*/
363+
@Deprecated
360364
public static byte[] sha(InputStream data) throws IOException {
361365
return digest(getShaDigest(), data);
362366
}
@@ -367,7 +371,9 @@ public static byte[] sha(InputStream data) throws IOException {
367371
* @param data
368372
* Data to digest
369373
* @return SHA-1 digest
374+
* @deprecated Use {@link #sha1(String)}
370375
*/
376+
@Deprecated
371377
public static byte[] sha(String data) {
372378
return sha(getBytesUtf8(data));
373379
}
@@ -735,7 +741,9 @@ public static String sha512Hex(String data) {
735741
* @param data
736742
* Data to digest
737743
* @return SHA-1 digest as a hex string
744+
* @deprecated Use {@link #sha1Hex(byte[])}
738745
*/
746+
@Deprecated
739747
public static String shaHex(byte[] data) {
740748
return Hex.encodeHexString(sha(data));
741749
}
@@ -749,7 +757,9 @@ public static String shaHex(byte[] data) {
749757
* @throws IOException
750758
* On error reading from the stream
751759
* @since 1.4
760+
* @deprecated Use {@link #sha1Hex(InputStream)}
752761
*/
762+
@Deprecated
753763
public static String shaHex(InputStream data) throws IOException {
754764
return Hex.encodeHexString(sha(data));
755765
}
@@ -760,7 +770,9 @@ public static String shaHex(InputStream data) throws IOException {
760770
* @param data
761771
* Data to digest
762772
* @return SHA-1 digest as a hex string
773+
* @deprecated Use {@link #sha1Hex(String)}
763774
*/
775+
@Deprecated
764776
public static String shaHex(String data) {
765777
return Hex.encodeHexString(sha(data));
766778
}

0 commit comments

Comments
 (0)