public static bool IsValidLength(long length, ContentHash hash) { if (length < 0 || length > LengthAndExistence.MaxSupportedLength || hash.IsSpecialValue()) { return(false); } ContentHash emptyHash = HashInfoLookup.Find(hash.HashType).EmptyHash; return(length == 0 ? (hash == emptyHash) : (hash != emptyHash)); }