PHP to the URL of the Chinese character encryption, but with the increase in the number of words, the encryption string has been increasing, want to let the length of the encryption character fixed, what good method?
Reply content:
PHP to the URL of the Chinese character encryption, but with the increase in the number of words, the encryption string has been increasing, want to let the length of the encryption character fixed, what good method?
If you want to put the encrypted content in the URL to pass, then there is no way an algorithm can be the length of the fixed content, encrypted into fixed-length content.
The encrypted content will certainly grow with the length of the data.
Because if this algorithm exists, what compression software is needed?
But if the encrypted content is not passed in the URL, another way, such as the encrypted content (or source content) is saved to the database,
Then pass the record ID or the result after the MD5/SHA1, and then, when used, pass this value in the data to check the record,
And then get the content that you originally wanted to preach.
In this case, its length can be fixed.
Many ways md5
, sha1
... As long as you don't want to decrypt ~
MD5 is not a fixed length?