Inside my code I'm generating hashes of URLs, (which are practically of unbounded length). I'm currently using sha1(), which I know has a tiny chance of a collision, but I have up to 255 bytes to store the hash in so feel that I might as well use that available space to lower the chance of collision even further.
Is there either:
- Another PHP hash function with a longer or customisable hash length?
- A way of using a fixed-length hash function like sha1 with a variable length input to generate a longer hash?
Or, is sha1's 20-byte hash good enough for anything and I should stop worrying about it?