Created
September 22, 2021 00:38
-
-
Save MayerDaniel/4b0ba8eaaf502cff39d55eb78647749b to your computer and use it in GitHub Desktop.
rol/ror
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __ROL__(num, count, bits=8): | |
return ((num << count) | (num >> (bits - count))) & ((0b1<<bits) - 1) | |
def __ROR__(num, count, bits=8): | |
return ((num >> count) | (num << (bits - count))) & ((0b1<<bits) - 1) | |
#from https://onsoim.tistory.com/entry/RORROL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment