Skip to content

Instantly share code, notes, and snippets.

View JanBednarik's full-sized avatar

Jan Bednařík JanBednarik

View GitHub Profile

Keybase proof

I hereby claim:

  • I am janbednarik on github.
  • I am honz (https://keybase.io/honz) on keybase.
  • I have a public key ASB-UgwJce_T6A0BBAAH_f5WUexrSavKxb0WO5zJQcnYsAo

To claim this, I am signing this object:

@JanBednarik
JanBednarik / Bits rotation
Last active March 30, 2016 14:52
Bits rotation
def rotate_left(byte):
"""
Rotate bits left.
"""
bit = byte & 0x80
byte <<= 1
if(bit):
byte |= 0x01
byte &= 0xFF
return byte