From 7115dcdc2c7b7062ca82ed3fd2ae861ebb47c232 Mon Sep 17 00:00:00 2001 From: James Adams Date: Mon, 16 Sep 2024 16:44:09 +0100 Subject: [PATCH] ProfileCache: Include type in checksum calculation \x1e is the record separator character --- src/main/perl/Fetch/ProfileCache.pm | 2 +- src/test/perl/cli.t | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/perl/Fetch/ProfileCache.pm b/src/main/perl/Fetch/ProfileCache.pm index ca12f2e..d325c97 100644 --- a/src/main/perl/Fetch/ProfileCache.pm +++ b/src/main/perl/Fetch/ProfileCache.pm @@ -411,7 +411,7 @@ sub ComputeChecksum unless (defined $value) { return md5_hex("__"); } - return md5_hex(encode_utf8($value)); + return md5_hex(encode_utf8("$value\x1e$type")); } } diff --git a/src/test/perl/cli.t b/src/test/perl/cli.t index fe3db5d..d980dd7 100644 --- a/src/test/perl/cli.t +++ b/src/test/perl/cli.t @@ -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;