What are the strengths and weaknesses of making a code by hashing the long address?
Sketch your own answer first, then compare it with the one below.
A strong answer
The same address always gives the same code, so duplicates are free and no coordination is needed.
Two different addresses can share a short prefix of the hash, so collisions still need a check and a re-hash with a salt. The scheme also cannot give two users separate links to one address unless the user is part of the hash input. A secure hash does not help guessability if the code is short.
Sources
- Roy Fielding, Mark Nottingham, Julian Reschke (2022). RFC 9110: HTTP Semantics.