You don't have to know the length though, just the length of potential collisions(so between 1 and whatever max length is the hash)
You don't have to know the length though, just the length of potential collisions(so between 1 and whatever max length is the hash)