3 ms·
Is the algorithm known to produce all theoretically possible hash values? Imagine a simple algorithm that should hash a string to a number 0-3, but due to an e
by dzek69 3y ago
Is the algorithm known to produce all theoretically possible hash values?
Imagine a simple algorithm that should hash a string to a number 0-3, but due to an extra condition it actually cannot produce "3", pseudocode:
```
Sum = sumOfAsciiCodeOfString(input);
Rest = Sum % 4;
Return Rest === 3 ? 2 : Rest;
```
Or due to a bug (replace `% 4` with `% 3`).
Can we prove that md5 doesn't suffer from such issues and it actually can output ffffffffffff or deaddeaddeaddead ?