Skip to content

Commit

Permalink
Merge pull request #216 from jrha/checksum_type
Browse files Browse the repository at this point in the history
ProfileCache: Include type in checksum calculation
  • Loading branch information
jrha authored Nov 29, 2024
2 parents 119241d + aed2f3f commit 2e95e6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/perl/Fetch/ProfileCache.pm
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ sub ComputeChecksum
unless (defined $value) {
return md5_hex("_<undef>_");
}
return md5_hex(encode_utf8($value));
return md5_hex(encode_utf8("$value\x1e$type"));
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/perl/cli.t
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ like($txt,
"dumpdb output path2eid");
# \0 separated list of subpaths
like($txt,
qr{eid2data:\n0 => a\0c\0e\n10000000 => nlist\n20000000 => 1740877ebcb53b5132e75cff986cd705\n1 => b}m,
qr{eid2data:\n0 => a\0c\0e\n10000000 => nlist\n20000000 => 3ee8d50d6f70735cfd53d9ea92215a22\n1 => b}m,
"dumpdb output eid2data");
like($txt,
qr{path2eid and eid2data combined:\n/ \(0\) =>\n V: a\0c\0e\n T: nlist\n C: 1740877ebcb53b5132e75cff986cd705\n/a \(1\) =>\n},
qr{path2eid and eid2data combined:\n/ \(0\) =>\n V: a\0c\0e\n T: nlist\n C: 3ee8d50d6f70735cfd53d9ea92215a22\n/a \(1\) =>\n},
"dumpdb ouptut combined path2eid eid2data");
diag $txt;

Expand Down

0 comments on commit 2e95e6a

Please sign in to comment.