Skip to content

Instantly share code, notes, and snippets.

View AveragePythonEnjoyer29's full-sized avatar
:shipit:
To commit, or not to commit. Thats the question

Oscar AveragePythonEnjoyer29

:shipit:
To commit, or not to commit. Thats the question
  • Netherlands
View GitHub Profile
@Unam3dd
Unam3dd / bitwise-cheatsheet.txt
Created June 22, 2022 11:01
bitwise operators tricks
atoi example
https://fr.wikipedia.org/wiki/Table_de_v%C3%A9rit%C3%A9
Bitwise tricks
All these tricks are also used in cryptography and obfuscation methods.
AND
Take bits in bytes
@cameronmaske
cameronmaske / encode.py
Last active July 16, 2024 20:44
base64 that actually encodes URL safe (no '=' nonsense)
"""
base64's `urlsafe_b64encode` uses '=' as padding.
These are not URL safe when used in URL paramaters.
Functions below work around this to strip/add back in padding.
See:
https://docs.python.org/2/library/base64.html
https://mail.python.org/pipermail/python-bugs-list/2007-February/037195.html
"""