educative.io

Educative

Why does url-encoded URLs matter if we are using an MD5 hash

for url ‘http://www.educative.io/distributed.php?id=design’, the md5 hash is ‘Xv\x85\n+\xac\xd4\x9aR\xf4\x84U\x84l\xce\x80’ and for url ‘http://www.educative.io/distributed.php%3Fid%3Ddesign’ the md5 has is ‘:\x199\x02J\x04\x13\xfdu0\xec\xca\xd2\xfeSd’.

With that being said, what’s the problem if we have an encoded URL?

1 Like

I don’t think there is any problem having encoded url. Encoded or not-encoded, both esentially points to the same resource.
Are you suggesting that we should encode URLs before creating a hash?

MD5 or any content based hash is a bad idea because it doesn’t fulfill our non-functional requirement of-

Shortened links should not be guessable (not predictable).