Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

roll binary c

// U can change the type by changing char to int
unsigned char rol(unsigned char value, unsigned char roll)
{
    roll = roll % sizeof(char) * 8;
    unsigned char mask_rolld = ~(0xFF >> roll);
    unsigned char lmb = (mask_rolld & value) >> (sizeof(char) * 8 - roll);
    return (value << roll) | lmb;
}
 
PREVIOUS NEXT
Tagged: #roll #binary
ADD COMMENT
Topic
Name
9+1 =