This file contains hidden or 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
#!/usr/bin/env python | |
## | |
## @file contrib/verifymessage/python/terracoin_verifymessage.py | |
## @brief terracoin signed message verification sample script. | |
## @author unknown author ; found on pastebin | |
## | |
import ctypes | |
import ctypes.util | |
import hashlib |
This file contains hidden or 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 pybitcointools import bitcoin as btctools | |
import time, hashlib | |
priv = "5JsunC55XGVqFQj5kPGK4MWgTL26jKbnPhjnmchSNPo75XXCwtk" | |
address = "1N2XWu5soeppX2qUjvrf81rpdbShKJrjTr" | |
sign = btctools.ecdsa_sign("hello", priv) | |
import base64 | |
def VerifyMessage(address, hash, sig): | |
sig = base64.b64decode(sig) |
This file contains hidden or 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
# | |
# key.py - OpenSSL wrapper | |
# Source: git://github.com/joric/brutus.git | |
# which was forked from git://github.com/samrushing/caesure.git | |
# | |
import ctypes | |
import ctypes.util | |
ssl = ctypes.cdll.LoadLibrary (ctypes.util.find_library ('ssl') or 'libeay32') |
This file contains hidden or 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
plugined_cache = {} | |
plugins = {} | |
def plugined(base_class): | |
class_name = base_class.__name__ | |
if class_name in plugined_cache: | |
PluginedClass = plugined_cache[class_name] | |
else: | |
classes = plugins[class_name]+[base_class] | |
classes.reverse() | |
PluginedClass = type(class_name, tuple(classes), dict()) |
This file contains hidden or 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
<html> | |
<body> | |
<style> | |
.bitcoinbar { | |
width: 150px; margin-top: 5px; display: inline-block; height: 20px; border-radius: 5px; position: relative; | |
font-family: Consolas, Monospace; background-color: #eee; color: black; vertical-align: bottom; text-decoration: none | |
} | |
.bitcoinbar .progress { | |
text-align: center; display: block; position: relative; | |
font-size: 11px; vertical-align: middle; line-height: 22px; |
This file contains hidden or 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
import time | |
# No plugin (without getattr 0.056s, with getattr 0.110s) | |
class Request(object): | |
def __init__(self): | |
pass | |
def route(self, req): |
This file contains hidden or 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
import gevent | |
from gevent import socket | |
from gevent import monkey | |
monkey.patch_socket() | |
import re, urllib2, httplib, logging | |
from urlparse import urlparse | |
from xml.dom.minidom import parseString |
NewerOlder