I want these 20 characters instead of these binary things what's the easy way?
Make it clear: this function will output a binary length of 160bit (that is, 20byte), where each 8bit binary corresponds to one character of the ASCII code, so this 160bit binary corresponds to 20 characters, which I want is the 20 characters.
This issue has been closed because of a duplicate of an existing problem
Reply content:
I want these 20 characters instead of these binary things what's the easy way?
Make it clear: this function will output a binary length of 160bit (that is, 20byte), where each 8bit binary corresponds to one character of the ASCII code, so this 160bit binary corresponds to 20 characters, which I want is the 20 characters.
If I do not understand it correctly, it returns the "binary" is exactly what you want, you may fall into the trap of your own thoughts.
This is a simple program that outputs 20-character ASCII values in turn, and it's easy to see that many of the non-printable characters (values less than 32) and extended regions (values greater than 127) are used to encode the UTF8 and GB series encoded in the extended area, So in these environments, the single byte of the coded area is meaningless, which is garbled.
$x = sha1("Shanghai", true);for ($i = 0; $i < strlen($x); $i++) { echo $x[$i] . "\t" . ord($x[$i]) . "\n";}
See also ASCII table: http://www.ascii-code.com/
Downstairs please ignore this answer
Don't know if this is the result you want:
参考: http://php.net/manual/en/function.sha1.php