Should be possible, depends exactly what you want to do but I've
done bitwise ops for implementing security algorithms.
Sample code below:
static public int OneByteValToByteStream(ref byte[] byteArr, int nStartIndex, byte byteVal)
{
for(int i=0; i<1; i++)
byteArr[nStartIndex++] = (byte)((byteVal>>(i*8))&0x00FF);
return nStartIndex;
}
for (j=0; j<2; j++)
{
x0 >>=1; if (x1 & 0x1) x0 |= 0x80;
x1 >>=1; if (x2 & 0x1) x1 |= 0x80;
x2 >>=1; if (x3 & 0x1) x2 |= 0x80;
x3 >>=1; if (x4 & 0x1) x3 |= 0x80;
x4 >>=1; if (carry & 1) x4 |= 0x80;
carry >>=1;
}
|