summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2014-04-13 17:13:51 -0300
committerJohn Wiegley <johnw@newartisans.com>2014-04-17 14:27:21 -0500
commit0ef825640963d60e4733553ff0e8c590c0ce2c3b (patch)
treeacea3a68341bc8dda85533b4cf9678c8e58c39f8 /src/filters.cc
parentefffabadfa360eb083e1e403d1e240a6fb6f3efa (diff)
downloadledger-0ef825640963d60e4733553ff0e8c590c0ce2c3b.tar.gz
ledger-0ef825640963d60e4733553ff0e8c590c0ce2c3b.tar.bz2
ledger-0ef825640963d60e4733553ff0e8c590c0ce2c3b.zip
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.
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc14
1 files changed, 7 insertions, 7 deletions
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<uintmax_t>(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));
}