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
from M2Crypto import EVP | |
from binascii import hexlify, unhexlify | |
def long_to_bytes(val, nrbytes=0): | |
hex_val = '%x' % abs(val) | |
if nrbytes: | |
padding = '0' * ((abs(nrbytes) * 2) - len(hex_val)) | |
else: | |
padding = '' | |
result = unhexlify(padding + hex_val)[::-1] |
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
;;; autopep8.el -- clean up python code | |
; | |
; based on js-beautify.el - http://sethmason.com/2011/04/28/jsbeautify-in-emacs.html | |
; Rescued from https://raw.github.com/tomscytale/autopep8/8792df48806eb3c9fb9d901529e4e967520e09c2/autopep8.el | |
; | |
; put this in your emacs init: | |
; (add-to-list 'load-path "~/dir/containing/autopep8/") | |
; (require 'autopep8) | |
; | |
; to use: |