Skip to content

Commit 914185b

Browse files
committed
Redirect SHA API calls to SHA-1 APIs.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1380826 13f79535-47bb-0310-9956-ffa450edef68
1 parent b8e9258 commit 914185b

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public static MessageDigest getSha512Digest() {
188188
*/
189189
@Deprecated
190190
public static MessageDigest getShaDigest() {
191-
return getDigest("SHA");
191+
return getSha1Digest();
192192
}
193193

194194
/**
@@ -349,7 +349,7 @@ public static String md5Hex(String data) {
349349
*/
350350
@Deprecated
351351
public static byte[] sha(byte[] data) {
352-
return getShaDigest().digest(data);
352+
return sha1(data);
353353
}
354354

355355
/**
@@ -365,7 +365,7 @@ public static byte[] sha(byte[] data) {
365365
*/
366366
@Deprecated
367367
public static byte[] sha(InputStream data) throws IOException {
368-
return digest(getShaDigest(), data);
368+
return sha1(data);
369369
}
370370

371371
/**
@@ -378,7 +378,7 @@ public static byte[] sha(InputStream data) throws IOException {
378378
*/
379379
@Deprecated
380380
public static byte[] sha(String data) {
381-
return sha(getBytesUtf8(data));
381+
return sha1(data);
382382
}
383383

384384
/**
@@ -748,7 +748,7 @@ public static String sha512Hex(String data) {
748748
*/
749749
@Deprecated
750750
public static String shaHex(byte[] data) {
751-
return Hex.encodeHexString(sha(data));
751+
return sha1Hex(data);
752752
}
753753

754754
/**
@@ -764,7 +764,7 @@ public static String shaHex(byte[] data) {
764764
*/
765765
@Deprecated
766766
public static String shaHex(InputStream data) throws IOException {
767-
return Hex.encodeHexString(sha(data));
767+
return sha1Hex(data);
768768
}
769769

770770
/**
@@ -777,7 +777,7 @@ public static String shaHex(InputStream data) throws IOException {
777777
*/
778778
@Deprecated
779779
public static String shaHex(String data) {
780-
return Hex.encodeHexString(sha(data));
780+
return sha1Hex(data);
781781
}
782782

783783
/**

0 commit comments

Comments
 (0)