Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # 8-Bit ring rotation to the left
- VAL=$(($1&0xFF)) # limit mask to 8 bit
- while [ $((LOOP=$LOOP+1)) -le $2 ]; do
- HBIT=$((($VAL&0x80)>>7)) # extract highest bit (bit 7)
- VAL=$(((($VAL<<1)|HBIT)&0xFF)) # rotate left, mask to 8 bit
- done
- exec numeric.sh $VAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement