Instead of having parameters such as i want to have .
This is because I don’t want to offer a simple way to see all content just by replacing 12 with 13, 14, 15 etc.
So I need a method which can encode a number into a string, and than decode.
something like
httP://mysite.com?image=+encode(myNumber);when I create the link and
decode(imageParam); when I get the value from the HTTp request.
Is there any method available which already does this?
Option 1:
Don’t use numbers to begin with. Use a GUID.
Option 2:
Hash your numbers. MD5 is a fast hash algorithm (though rather weak and the original value easily discoverable these days). You may want to use SHA1 or SHA2 instead.
Option 3:
Encrypt your numbers so you can decrypt them back later. This would normally be computationally very intensive.
I would personally go with option 1 and not use integers at all.