Skip to content

Instantly share code, notes, and snippets.

@dhrumilp15
Created April 11, 2021 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhrumilp15/61f34253897928b3cffebc1c8659c105 to your computer and use it in GitHub Desktop.
Save dhrumilp15/61f34253897928b3cffebc1c8659c105 to your computer and use it in GitHub Desktop.
def g(i):
'''Reverses i in binary and fills the right side with 0s'''
b = bin(i).lstrip("0b").rstrip("L").rjust(BLOCK_LEN * 8, "0")
return int(b[::-1], 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment