Sign a string using SHA1, then shrink it using url-safe base65

Over at Django Snippets, Simon Willison have an interesting way of creating a tamper-proof URLs and cookies by signing them, but without the overhead of a full 40 character SHA1 hash.

He experimented further and was able to knock a 40 char hash down to 27 characters by encoding it using a custom base65 encoding which only uses URL-safe characters.

Post a Comment

Your email is never published nor shared. Required fields are marked *