Skip to content

Instantly share code, notes, and snippets.

@wireboy5
Last active August 22, 2020 02:42
Show Gist options
  • Save wireboy5/ae70a78a251252e67087397c7de6b8ab to your computer and use it in GitHub Desktop.
Save wireboy5/ae70a78a251252e67087397c7de6b8ab to your computer and use it in GitHub Desktop.
## Delta Encoding for bytes of the same size in a single line lambda function. No external or standard libraries required
deltaSameLength = lambda d1,d2: b''.join([bytes().fromhex(hex(b1^b2).replace("0x","").rjust(2,"0")) for b1,b2 in zip(d1,d2)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment