Skip to content

Instantly share code, notes, and snippets.

View ly0's full-sized avatar
👊
已全仓买入

latyas ly0

👊
已全仓买入
View GitHub Profile
@ly0
ly0 / bitcoin.py
Created September 2, 2023 20:28 — forked from HelloZeroNet/bitcoin.py
Bitcoin signature signing and verficiation using coincurve
import hashlib
import struct
from coincurve import PrivateKey, PublicKey
from base58 import b58encode_check, b58decode_check
from hmac import compare_digest
RECID_MIN = 0
RECID_MAX = 3
RECID_UNCOMPR = 27
LEN_COMPACT_SIG = 65
@ly0
ly0 / adhoc
Created April 19, 2014 15:43 — forked from anonymous/adhoc
#!/bin/bash
#####################################
#Author: Leon Lee #
#email: lendylongli@gmail.com #
#QQ: 730395591 #
#Version: 1.0 #
#Note: If you have some good ideas #
# or advice, please mail me^^ #
#####################################
r = requests.get(file_url)
size = int(r.headers['Content-Length'].strip())
self.bytes = 0
widgets = [name, ": ", Bar(marker="|", left="[", right=" "),
Percentage(), " ", FileTransferSpeed(), "] ",
self,
" of {0}MB".format(str(round(size / 1024 / 1024, 2))[:4])]
pbar = ProgressBar(widgets=widgets, maxval=size).start()
file = []
for buf in r.iter_content(1024):