url rewriting - Convert AWS URL to something shorter (without database) -
we're serving bunch of images on our website hosted on aws, , they're named 0e261dda-cbb7-4b99-b863-6d7640dc2fd8.jpg. maintain simple path these images via our website keeping same name image - strip out dashes create little bit shorter.
but since we'll sharing path these images via twitter we'd love string shorter still, don't want utilize database url shortening (either rolling our own or using else's). rather have lossless compression scheme on string.
given fact aws name apparently using hexadecimal characters, seem converting ascii (after removing dashes) @ to the lowest degree bit of compression , easy lookup actual path on server.
anybody have/seen little bit of code can spit out url-safe ascii equivalent aforementioned hex string?
use higher base. hexidecimal base of operations 16. utilize number of higher base of operations (36 mutual in url shortners, go 62 (10 digits, 26 upper case letters 26 lower case letters)
your base of operations 16 string:
0e261ddacbb74b99b8636d7640dc2fd8
in base of operations 36:
u5lc6fos2f9e70ww3kat3kk8
in base of operations 62 (bit less reliable, case sensitive):
qhjl1gbuzhsyjoiq3ia0u
url-rewriting amazon-web-services hex ascii
No comments:
Post a Comment