diff options
Diffstat (limited to 'src/filters.cc')
-rw-r--r-- | src/filters.cc | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/filters.cc b/src/filters.cc index 71d835e6..523fa795 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -237,8 +237,6 @@ void anonymize_posts::render_commodity(amount_t& amt) void anonymize_posts::operator()(post_t& post) { - boost::uuids::detail::sha1 sha; - boost::uuids::detail::sha1::digest_type message_digest; bool copy_xact_details = false; if (last_xact != post.xact) { @@ -255,12 +253,7 @@ void anonymize_posts::operator()(post_t& post) std::ostringstream buf; buf << reinterpret_cast<boost::uintmax_t>(post.xact->payee.c_str()) << integer_gen() << post.xact->payee.c_str(); - - sha.reset(); - sha.process_bytes(buf.str().c_str(), buf.str().length()); - sha.get_digest(message_digest); - - xact.payee = digest_to_hex(message_digest, 8); + xact.payee = sha1sum(buf.str(), 8); xact.note = none; } else { xact.journal = post.xact->journal; @@ -273,12 +266,7 @@ void anonymize_posts::operator()(post_t& post) acct = acct->parent) { std::ostringstream buf; buf << integer_gen() << acct << acct->fullname(); - - sha.reset(); - sha.process_bytes(buf.str().c_str(), buf.str().length()); - sha.get_digest(message_digest); - - account_names.push_front(digest_to_hex(message_digest, 8)); + account_names.push_front(sha1sum(buf.str(), 8)); } account_t * new_account = |