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.
精彩评论