summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authordbear496 <70439542+dbear496@users.noreply.github.com>2024-09-14 18:21:29 -0400
committerJohn Wiegley <johnw@newartisans.com>2024-09-16 14:40:23 -0400
commit124398c35be573324cf2384c08b99b4476f29e2b (patch)
tree7638037273d6d3f19382fffd4befec7f60488a1a /src/filters.cc
parent62f626fa73bd6832028f43c204c43cf15bd5f409 (diff)
downloadfork-ledger-124398c35be573324cf2384c08b99b4476f29e2b.tar.gz
fork-ledger-124398c35be573324cf2384c08b99b4476f29e2b.tar.bz2
fork-ledger-124398c35be573324cf2384c08b99b4476f29e2b.zip
use sha1sum in anonymize_posts::operator()
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc16
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 =