I personally recommend two articles: https://www.byvoid.com/blog/string-hash-compare http://blog.csdn.net/icefireelf/article/details/5796529
Can you treat a Chinese character (wide character) as several ASCII characters and apply these algorithms?
Ten Chinese characters, if encoded in GB2312, are 20 bytes. If you directly use these 20 bytes as a "Hash value", there will be no conflict.
By the way, the length of SHA1 is also 160bit, which is 20 bytes. SHA512 is even longer, so it’s better not to use it
I personally recommend two articles:
https://www.byvoid.com/blog/string-hash-compare
http://blog.csdn.net/icefireelf/article/details/5796529
Can you treat a Chinese character (wide character) as several ASCII characters and apply these algorithms?
Ten Chinese characters, if encoded in GB2312, are 20 bytes. If you directly use these 20 bytes as a "Hash value", there will be no conflict.
By the way, the length of SHA1 is also 160bit, which is 20 bytes. SHA512 is even longer, so it’s better not to use it