Urgent: how to use php to encrypt and decrypt url parameters? because base64_encode () is generated too long and too simple, is there any other way? ------ solution ------------------ try js: for example: javaScript code involves three functions: escape, encodeURI, and encodeURIComponent. how to use php to encrypt and decrypt url parameters?
Because base64_encode () is generated too long and too simple, is there any other way
------ Solution --------------------
You can try js:
For example, JavaScript code involves three functions: escape, encodeURI, and encodeURIComponent. the corresponding three decoding functions are: unescape, decodeURI, and decodeURIComponent.
------ Solution --------------------
Base64 is only 1/4 longer than the original string
If you still think it is long, you should consider shortening the original string, not the conversion algorithm.
Because even if the original string length can be maintained, it is difficult to ensure that all characters are applicable to URLs.
------ Solution --------------------
Reference:
Base64 is only 1/4 longer than the original string
If you still think it is long, you should consider shortening the original string, not the conversion algorithm.
Because even if the original string length can be maintained, it is difficult to ensure that all characters are applicable to URLs.
The original string specification has been written by the customer and needs to be encrypted. it is impossible to shorten the original string and the original length can only be kept as much as possible. Base64 is only encoded, not encrypted or non-conforming
------ Solution --------------------
Reference:
Base64 is only 1/4 longer than the original string
If you still think it is long, you should consider shortening the original string, not the conversion algorithm.
Because even if the original string length can be maintained, it is difficult to ensure that all characters are applicable to URLs.
This method is good. thank you for your comments.