summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-04-19 21:56:14 -0700
committerCraig Earls <enderw88@gmail.com>2014-04-19 21:56:14 -0700
commitfd18f58392833d6e1b1c06a7700f8afc37711c87 (patch)
tree895daa013b63caeed47bd944daba89003e9b34ce /src/utils.h
parent7faaeb301fe524422c694e54fa36248ffedfa9b8 (diff)
parenta0c5addbbdaf472d26ae25c86ff826e509b3ee17 (diff)
downloadfork-ledger-fd18f58392833d6e1b1c06a7700f8afc37711c87.tar.gz
fork-ledger-fd18f58392833d6e1b1c06a7700f8afc37711c87.tar.bz2
fork-ledger-fd18f58392833d6e1b1c06a7700f8afc37711c87.zip
Merge commit 'a0c5addbbdaf472d26ae25c86ff826e509b3ee17'
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/utils.h b/src/utils.h
index 70b3bae9..c3dcf562 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -44,6 +44,8 @@
#ifndef _UTILS_H
#define _UTILS_H
+#include <boost/uuid/sha1.hpp>
+
/**
* @name Default values
*/
@@ -483,11 +485,7 @@ inline void check_for_signal() {
/*@{*/
#define foreach BOOST_FOREACH
-#if HAVE_CXX11
using std::unique_ptr;
-#else
-#define unique_ptr std::auto_ptr
-#endif
namespace ledger {
@@ -625,11 +623,12 @@ inline string to_hex(unsigned int * message_digest, const int len = 1)
inline string sha1sum(const string& str)
{
- SHA1 sha;
- sha.Reset();
- sha << str.c_str();
+ boost::uuids::detail::sha1 sha;
+
+ sha.process_bytes(str.c_str(), str.length());
+
unsigned int message_digest[5];
- sha.Result(message_digest);
+ sha.get_digest(message_digest);
return to_hex(message_digest, 5);
}