If I want the binary equivalent of a 1000 bytes string(MyStr), I can do it that way :

Dim k As Integer, j As Integer
Dim temp as string
For k = 1 To Len(MyStr)
For j = 7 To 0 Step -1
If Mid(MyStr,k,1) And (2 ^ j) Then
Temp = Temp & "1"
Else
Temp = Temp & "0"
End If
Next j
Next k

Then, if I want to work on 6-bit parts of the binary string I do:

For i = 1 to Len(temp)- 5 step 6
'do whatever with Mid(temp, i, 6)
next i

How can I be faster? what kind of API call
can do it?

thank you