isLegacyHash method

bool isLegacyHash(
  1. String hash
)

Returns true if hash is in the legacy SHA-1 format (40 hex characters).

Used to detect hashes stored by an older version of the catalog engine that used SHA-1 instead of FNV-1a, so they can be silently migrated without triggering spurious "source changed" states.

Implementation

bool isLegacyHash(String hash) {
  if (hash.length != 40) return false;
  return _legacySha1HashPattern.hasMatch(hash);
}