util: deprecate crypto::computeSha256Digest()
Use Sha256::computeDigest() instead.
Change-Id: I9db5b4839559c9c7930cdc24c78f35ca76b25b52
diff --git a/src/util/digest.cpp b/src/util/digest.cpp
index 55eb459..8053fdb 100644
--- a/src/util/digest.cpp
+++ b/src/util/digest.cpp
@@ -29,6 +29,8 @@
namespace ndn {
namespace util {
+const size_t Sha256::DIGEST_SIZE;
+
Sha256::Sha256()
{
reset();
@@ -130,6 +132,14 @@
return toHex(*buf);
}
+ConstBufferPtr
+Sha256::computeDigest(const uint8_t* buffer, size_t size)
+{
+ Sha256 sha256;
+ sha256.update(buffer, size);
+ return sha256.computeDigest();
+}
+
std::ostream&
operator<<(std::ostream& os, Sha256& digest)
{