@BinaryReverse

Parent Previous Next

@BinaryReverse.

Uses the input to return a blob where the bytes and/or the bits are reversed.


Syntax.


 @BinaryReverse(Blob bytes; Boolean reverseBytes, reverseBits) : Blob

 


Arguments:


Example:


 Blob res, bytes := 0x010203;

 res := @BinaryReverse(bytes, True, True);

 //Now res == 0xC04080;


 //Calculation:

 //0x010203 ~ 0000 0001 0000 0010 0000 0011

 //---------------------------------------- reverse bytes

 //0x030201 ~ 0000 0011 0000 0010 0000 0001

 //---------------------------------------- reverse bits

 //0xC04080 ~ 1100 0000 0100 0000 1000 0000

 //========================================