我嘗試哈希一些unicode字符串:哈希unicode字符串在python
hashlib.sha1(s).hexdigest()
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-81:
ordinal not in range(128)
其中s
是一樣的東西:
œ∑¡™£¢∞§¶•ªº–≠œ∑´®†¥¨ˆøπ「‘åß∂ƒ©˙∆˚¬…æΩ≈ç√∫˜µ≤≥÷åйцукенгшщзхъфывапролджэячсмитьбююю..юбьтијџўќ†њѓѕ'‘「«««\dzћ÷…•∆љl«єђxcvіƒm≤≥ї[email protected]#$©^&*(()––––––––––∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆∆•…÷ћzdzћ÷…•∆љlљ∆•…÷ћzћ÷…•∆љ∆•…љ∆•…љ∆•…∆љ•…∆љ•…љ∆•…∆•…∆•…∆•∆…•÷∆•…÷∆•…÷∆•…÷∆•…÷∆•…÷∆•…÷∆•…
我應該怎麼解決?
這是一個Unicode字符串嗎? – 2017-03-13 10:47:11