Is it possible to do something like this with regular expressions: encode and decode a number?
For example I want to encode the id 15123
(which actually represents a port number in my case) into something which is useless to a user, for example a seemingly random string such as c95Dd7!7
. And then decode it afterwards.
I want to do this with a regular expression because I will need the decoded id for URL Rewriting.
I know javascript packer does about the same... but I have no clue where to start. Or are there any out-of-the-box examples or solutions for my question?
Thanks!