Skip to content

Instantly share code, notes, and snippets.

@phelixbtc
phelixbtc / requestsfingerprint.py
Last active August 29, 2015 14:17
requests fingerprint
"""
requests based url opener with support self supplied fingerprints
"""
debug = True
try:
import requests
except ImportError:
@phelixbtc
phelixbtc / auxpowpuzzle.py
Created March 12, 2015 16:43
Namecoin AuxPOW Puzzle
import hashlib
import struct
####http://python-bitcoinlib.readthedocs.org/en/latest/_modules/bitcoin/core/serialize.html
def uint256_from_str(s):
"""Convert bytes to uint256"""
r = 0
t = struct.unpack(b"<IIIIIIII", s[:32])
for i in range(8):
r += t[i] << (i * 32)