开发者

SHA-1 and Unicode

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜