A bit manipulation readability enhancement library.
Performs a bitwise left rotation on a number.
public static byte RotateLeft(this byte number, int count);
number
System.Byte
The number to rotate
count
System.Int32
the number of bits to rotate
System.Byte The rotated value.
Examples
byte b = 0b00001111;
var b2 = b.RotateLeft(3); // b2 = 0b01111000
var b3 = b.RotateLeft(4); // b3 = 0b11110000
var b4 = b.RotateLeft(5); // b4 = 0b11100001
var b5 = b.RotateLeft(6); // b5 = 0b11000011
var b6 = b.RotateLeft(7); // b6 = 0b10000111
var b7 = b.RotateLeft(8); // b7 = 0b00001111