Is there a built-in function to reverse bit order

后端 未结 8 1370
情书的邮戳
情书的邮戳 2020-12-13 00:34

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

8条回答
  •  孤街浪徒
    2020-12-13 01:09

    Using @Chads link

    byte b; 
    b = 0x9D;
    b = (byte)((b * 0x0202020202 & 0x010884422010) % 1023); 
    

    Edit: Forgot the cast

提交回复
热议问题