3 ms·
It seems like you have to run the slow collision-resistant thing over the whole file.
by anonymoushn 3y ago
It seems like you have to run the slow collision-resistant thing over the whole file.
- londons_explore 3y agoCollision detection is far cheaper. One method: Simply add up all the bytes of all seen placenames while running your fast algorithm. This is effectively a checksum of all bytes of placename data. Then at the end, calculate the 'correct' name-sum (which can be done cheaply). If it doesn't match, a collision occurred.
- anonymoushn 3y agoYou can design inputs that defeat this scheme though. I thought the point was to be correct for all valid inputs.