I\'ve come up with several manual ways of doing this, but i keep wondering if there is something built-in .NET that does this.
Basically, i want to reverse the bit o
No, there isn't anything in the BCL for this.
But, assuming you want something fast:
Since there are only 8 bits, it pays to unroll the loop (use 4 statements instead of the for-loop).
For an even faster solution, create a 256 entry lookup table.
And you can of course wrap both methods in a function so that the usage only takes 1 statement.
I found a page for this problem.