Skip to content

Commit d47ef8f

Browse files
committed
CODEC-193 Support java.nio.ByteBuffer in DigestUtils
Drop algo-specific methods in favour of generic ones git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1744411 13f79535-47bb-0310-9956-ffa450edef68
1 parent 3b6468a commit d47ef8f

1 file changed

Lines changed: 0 additions & 144 deletions

File tree

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

Lines changed: 0 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -347,18 +347,6 @@ public static byte[] md2(final byte[] data) {
347347
return getMd2Digest().digest(data);
348348
}
349349

350-
/**
351-
* Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>.
352-
*
353-
* @param data
354-
* Data to digest
355-
* @return MD2 digest
356-
* @since 1.11
357-
*/
358-
public static byte[] md2(final ByteBuffer data) {
359-
return digest(getMd2Digest(), data);
360-
}
361-
362350
/**
363351
* Calculates the MD2 digest and returns the value as a 16 element <code>byte[]</code>.
364352
*
@@ -397,18 +385,6 @@ public static String md2Hex(final byte[] data) {
397385
return Hex.encodeHexString(md2(data));
398386
}
399387

400-
/**
401-
* Calculates the MD2 digest and returns the value as a 32 character hex string.
402-
*
403-
* @param data
404-
* Data to digest
405-
* @return MD2 digest as a hex string
406-
* @since 1.11
407-
*/
408-
public static String md2Hex(final ByteBuffer data) {
409-
return Hex.encodeHexString(md2(data));
410-
}
411-
412388
/**
413389
* Calculates the MD2 digest and returns the value as a 32 character hex string.
414390
*
@@ -446,18 +422,6 @@ public static byte[] md5(final byte[] data) {
446422
return getMd5Digest().digest(data);
447423
}
448424

449-
/**
450-
* Calculates the MD5 digest and returns the value as a 16 element <code>byte[]</code>.
451-
*
452-
* @param data
453-
* Data to digest
454-
* @return MD5 digest
455-
* @since 1.11
456-
*/
457-
public static byte[] md5(final ByteBuffer data) {
458-
return digest(getMd5Digest(), data);
459-
}
460-
461425
/**
462426
* Calculates the MD5 digest and returns the value as a 16 element <code>byte[]</code>.
463427
*
@@ -494,18 +458,6 @@ public static String md5Hex(final byte[] data) {
494458
return Hex.encodeHexString(md5(data));
495459
}
496460

497-
/**
498-
* Calculates the MD5 digest and returns the value as a 32 character hex string.
499-
*
500-
* @param data
501-
* Data to digest
502-
* @return MD5 digest as a hex string
503-
* @since 1.11
504-
*/
505-
public static String md5Hex(final ByteBuffer data) {
506-
return Hex.encodeHexString(md5(data));
507-
}
508-
509461
/**
510462
* Calculates the MD5 digest and returns the value as a 32 character hex string.
511463
*
@@ -585,18 +537,6 @@ public static byte[] sha1(final byte[] data) {
585537
return getSha1Digest().digest(data);
586538
}
587539

588-
/**
589-
* Calculates the SHA-1 digest and returns the value as a <code>byte[]</code>.
590-
*
591-
* @param data
592-
* Data to digest
593-
* @return SHA-1 digest
594-
* @since 1.11
595-
*/
596-
public static byte[] sha1(final ByteBuffer data) {
597-
return digest(getSha1Digest(), data);
598-
}
599-
600540
/**
601541
* Calculates the SHA-1 digest and returns the value as a <code>byte[]</code>.
602542
*
@@ -634,18 +574,6 @@ public static String sha1Hex(final byte[] data) {
634574
return Hex.encodeHexString(sha1(data));
635575
}
636576

637-
/**
638-
* Calculates the SHA-1 digest and returns the value as a hex string.
639-
*
640-
* @param data
641-
* Data to digest
642-
* @return SHA-1 digest as a hex string
643-
* @since 1.11
644-
*/
645-
public static String sha1Hex(final ByteBuffer data) {
646-
return Hex.encodeHexString(sha1(data));
647-
}
648-
649577
/**
650578
* Calculates the SHA-1 digest and returns the value as a hex string.
651579
*
@@ -687,18 +615,6 @@ public static byte[] sha256(final byte[] data) {
687615
return getSha256Digest().digest(data);
688616
}
689617

690-
/**
691-
* Calculates the SHA-256 digest and returns the value as a <code>byte[]</code>.
692-
*
693-
* @param data
694-
* Data to digest
695-
* @return SHA-256 digest
696-
* @since 1.11
697-
*/
698-
public static byte[] sha256(final ByteBuffer data) {
699-
return digest(getSha256Digest(), data);
700-
}
701-
702618
/**
703619
* Calculates the SHA-256 digest and returns the value as a <code>byte[]</code>.
704620
* <p>
@@ -746,18 +662,6 @@ public static String sha256Hex(final byte[] data) {
746662
return Hex.encodeHexString(sha256(data));
747663
}
748664

749-
/**
750-
* Calculates the SHA-256 digest and returns the value as a hex string.
751-
*
752-
* @param data
753-
* Data to digest
754-
* @return SHA-256 digest as a hex string
755-
* @since 1.11
756-
*/
757-
public static String sha256Hex(final ByteBuffer data) {
758-
return Hex.encodeHexString(sha256(data));
759-
}
760-
761665
/**
762666
* Calculates the SHA-256 digest and returns the value as a hex string.
763667
* <p>
@@ -805,18 +709,6 @@ public static byte[] sha384(final byte[] data) {
805709
return getSha384Digest().digest(data);
806710
}
807711

808-
/**
809-
* Calculates the SHA-384 digest and returns the value as a <code>byte[]</code>.
810-
*
811-
* @param data
812-
* Data to digest
813-
* @return SHA-384 digest
814-
* @since 1.11
815-
*/
816-
public static byte[] sha384(final ByteBuffer data) {
817-
return digest(getSha384Digest(), data);
818-
}
819-
820712
/**
821713
* Calculates the SHA-384 digest and returns the value as a <code>byte[]</code>.
822714
* <p>
@@ -864,18 +756,6 @@ public static String sha384Hex(final byte[] data) {
864756
return Hex.encodeHexString(sha384(data));
865757
}
866758

867-
/**
868-
* Calculates the SHA-384 digest and returns the value as a hex string.
869-
*
870-
* @param data
871-
* Data to digest
872-
* @return SHA-384 digest as a hex string
873-
* @since 1.11
874-
*/
875-
public static String sha384Hex(final ByteBuffer data) {
876-
return Hex.encodeHexString(sha384(data));
877-
}
878-
879759
/**
880760
* Calculates the SHA-384 digest and returns the value as a hex string.
881761
* <p>
@@ -923,18 +803,6 @@ public static byte[] sha512(final byte[] data) {
923803
return getSha512Digest().digest(data);
924804
}
925805

926-
/**
927-
* Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>.
928-
*
929-
* @param data
930-
* Data to digest
931-
* @return SHA-512 digest
932-
* @since 1.11
933-
*/
934-
public static byte[] sha512(final ByteBuffer data) {
935-
return digest(getSha512Digest(), data);
936-
}
937-
938806
/**
939807
* Calculates the SHA-512 digest and returns the value as a <code>byte[]</code>.
940808
* <p>
@@ -982,18 +850,6 @@ public static String sha512Hex(final byte[] data) {
982850
return Hex.encodeHexString(sha512(data));
983851
}
984852

985-
/**
986-
* Calculates the SHA-512 digest and returns the value as a hex string.
987-
*
988-
* @param data
989-
* Data to digest
990-
* @return SHA-512 digest as a hex string
991-
* @since 1.11
992-
*/
993-
public static String sha512Hex(final ByteBuffer data) {
994-
return Hex.encodeHexString(sha512(data));
995-
}
996-
997853
/**
998854
* Calculates the SHA-512 digest and returns the value as a hex string.
999855
* <p>

0 commit comments

Comments
 (0)