Project

General

Profile

Actions

Bug #4838

closed

Possible issues hashing the name URI, not the TLV

Added by Anonymous almost 6 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

This is a low priority observation. When ProducerBase::updateSeqNo computes the new hash, it uses the name URI string.
https://github.com/named-data/PSync/blob/0cf4b600e91455ee07c38eb22876aa6b653bc14b/PSync/producer-base.cpp#L121

uint32_t newHash = murmurHash3(N_HASHCHECK, prefixWithSeq.toUri());

I don't think that the NDN packet spec guarantees that all implementations will create the same URI string for a Name. For example upper/lower case for hex digits, different ways of representing the name component type number, different choices of which values to percent escape, etc. Also, because of lots of conversion from binary to decimal/hexadecimal values and string concatenation, it can be less efficient to get the URI string than to encode the name TLV. (Of course, if consumers and producers have different implementations of toUri(), their hashes will not match.)

For these reasons, I humbly suggest that PSync should compute the hash from the Name TLV encoding, not from the URI string.

Actions

Also available in: Atom PDF