Skip to content

Commit d71c011

Browse files
[#70] Note CRC is a within-database fingerprint (ref #74)
1 parent 505eb48 commit d71c011

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Analyzer/PPtrAndCrcProcessor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ namespace UnityDataTools.Analyzer;
1313
// 2. Accumulate a CRC32 over the object's serialized bytes, including the content of external
1414
// streams (texture/mesh/audio data stored in companion .resS/.resource files). This CRC is a
1515
// content fingerprint used to detect whether two objects are identical.
16+
// NOTE: references contribute their resolved analyzer object id (see ExtractPPtr), so the CRC
17+
// is only comparable within a single analyze database, not between separate runs - see issue #74.
1618
// CRC computation can be disabled (skipCrc) while still extracting references.
1719
public class PPtrAndCrcProcessor : IDisposable
1820
{
@@ -416,6 +418,10 @@ private void ExtractPPtr(string referencedType)
416418
{
417419
var refId = m_Callback(m_ObjectId, fileId, pathId, m_StringBuilder.ToString(), referencedType);
418420

421+
// The CRC folds in the resolved analyzer object id rather than the raw PPtr
422+
// (fileId/pathId). This normalizes references so duplicate objects in different bundles
423+
// hash the same within a database, but it makes the CRC depend on per-run id assignment,
424+
// so CRCs are not comparable between separate databases. See issue #74.
419425
if (!m_SkipCrc)
420426
{
421427
m_pptrBytes[0] = (byte)(refId >> 24);

0 commit comments

Comments
 (0)