Hello,

I would like to convert a byte string like b"abe34" into a BitArray. I 
could use this function, but it will be horribly slow :

function bytesToBitarray(s::Array{Uint8,1}) 
       t = BitArray(size(s, 1)*8)
       for i in 1:size(s, 1)
           for j in 0:7
             t[8(i-1) + j + 1] = s[i] & (1<<j)
           end
       end
       t
 end

 how can I do this efficiently ?

Sébastien

Reply via email to