Map incrementing integer range to six-digit base 26 max, but unpredictably

前端 未结 8 1398
时光说笑
时光说笑 2020-12-04 22:39

I want to design a URL shortener for a particular use case and type of end-user that I have targetted. I have decided that I want the URLs to be stored internally according

8条回答
  •  悲哀的现实
    2020-12-04 23:22

    You need a Block Cipher with "Block Space" of 266.

    Choose an arbitrary key for the cipher, and you now have a transformation that is reversible by you, yet unpredictable for everyone else.

    Your block size is a bit unusual, so you probably won't find a ready-made good block cipher for your size. But as suggested by kquinn you can design one on your own that mimics other ciphers.

提交回复
热议问题