开发者

SHA-1 and Unicode

开发者 https://www.devze.com 2022-12-25 23:48 出处:网络
Is behavior of SHA-1 algorithm defined for Unicode strings? I do realize that SHA-1 开发者_运维知识库itself does not care about the content of the string, however,

Is behavior of SHA-1 algorithm defined for Unicode strings? I do realize that SHA-1 开发者_运维知识库itself does not care about the content of the string, however,

it seems to me that in order to pass standard tests for SHA-1, the input string should be encoded with UTF-8.


SHA-1 is based on bytes; it doesn't care about the structure of the data. If you give it a bunch of bytes that consists of Unicode strings, you'll get a result. Keep in mind that the block size is 512 bits, so smaller amounts of data may cause security issues.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号