Bit rotation question/challenge

Paul Backus snarwin at gmail.com
Sat Jan 30 14:17:06 UTC 2021


On Saturday, 30 January 2021 at 13:30:49 UTC, burt wrote:
> I have a static array of `ubyte`s of arbitrary size:
>
> ```d
> ubyte[4] x = [ // in reality, ubyte[64]
>     0b00001000,
>     0b00000001,
>     0b00010101,
>     0b11110010,
> ];
> ```
>
> Now I want to bit-rotate the array as if it is one big integer.

You may find `std.bitmanip.BitArray` useful for this:

http://phobos.dpldocs.info/std.bitmanip.BitArray.html


More information about the Digitalmars-d-learn mailing list