我想要拆分ByteString到的話,像這樣: import qualified Data.ByteString as BS
main = do
input <- BS.getLine
let xs = BS.split ' ' input
但看來,GHC本身不能字符文字轉換爲Word8,所以我就: Couldn't match expected type `GHC.W
剛剛在7天內學會了Python 3,我感覺我對字節字符串的理解存在一點漏洞。在Python 3中,假設我有一個字節字符串b'1234'。它的迭代器返回一個整數: Python 3.2.3 (default, May 26 2012, 18:49:27)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "cop
我使用PyCrypto和python 2.7.3。我試圖在散列前加一個常規字符串來創建一個鏈式散列,但爲了保持格式一致,我需要字符串s在'打印'形式而不是二進制形式。有沒有辦法將二進制字符串轉換爲可操作的「普通」字符串? from Crypto.Hash import SHA256
h = SHA256.new()
s = h.digest() #return binary "non-prin