From 0ef825640963d60e4733553ff0e8c590c0ce2c3b Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 13 Apr 2014 17:13:51 -0300 Subject: Replace sha1.cc with boost::uuid::details::sha1 sha1.cc is not redistributable by Debian because the license doesn't permit redistribution of modified versions. This isn't ideal since the ::details namespace is subject to change, but it avoids adding a dependency to ledger. --- src/filters.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/filters.cc') diff --git a/src/filters.cc b/src/filters.cc index 4046ebda..bdc2983b 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -237,7 +237,7 @@ void anonymize_posts::render_commodity(amount_t& amt) void anonymize_posts::operator()(post_t& post) { - SHA1 sha; + boost::uuids::detail::sha1 sha; unsigned int message_digest[5]; bool copy_xact_details = false; @@ -256,9 +256,9 @@ void anonymize_posts::operator()(post_t& post) buf << reinterpret_cast(post.xact->payee.c_str()) << integer_gen() << post.xact->payee.c_str(); - sha.Reset(); - sha << buf.str().c_str(); - sha.Result(message_digest); + sha.reset(); + sha.process_bytes(buf.str().c_str(), buf.str().length()); + sha.get_digest(message_digest); xact.payee = to_hex(message_digest); xact.note = none; @@ -274,9 +274,9 @@ void anonymize_posts::operator()(post_t& post) std::ostringstream buf; buf << integer_gen() << acct << acct->fullname(); - sha.Reset(); - sha << buf.str().c_str(); - sha.Result(message_digest); + sha.reset(); + sha.process_bytes(buf.str().c_str(), buf.str().length()); + sha.get_digest(message_digest); account_names.push_front(to_hex(message_digest)); } -- cgit v1.2.3