Mercurial > public > bitcaviar-plus
comparison src/puppy/helpers.py @ 10:6e9f420c117e
refactor code
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Tue, 26 Oct 2021 08:56:59 +0200 |
parents | e218f70e19e9 |
children |
comparison
equal
deleted
inserted
replaced
9:e218f70e19e9 | 10:6e9f420c117e |
---|---|
3 """ | 3 """ |
4 Helper methods | 4 Helper methods |
5 """ | 5 """ |
6 | 6 |
7 | 7 |
8 def get_var_int(f): | 8 def __get_var_int(f): |
9 """ | 9 """ |
10 A VarInt (variable integer) is a field used in transaction data to indicate the number of upcoming fields, | 10 A VarInt (variable integer) is a field used in transaction data to indicate the number of upcoming fields, |
11 or the length of an upcoming field. | 11 or the length of an upcoming field. |
12 More info: https://learnmeabitcoin.com/technical/varint | 12 More info: https://learnmeabitcoin.com/technical/varint |
13 :param f: buffer, required | 13 :param f: buffer, required |
26 number_of_transactions = prefix | 26 number_of_transactions = prefix |
27 | 27 |
28 return number_of_transactions | 28 return number_of_transactions |
29 | 29 |
30 | 30 |
31 def compute_hash(data): | 31 def __compute_hash(data): |
32 """ | 32 """ |
33 Get hash | 33 Get hash |
34 :param data: bytes, required | 34 :param data: bytes, required |
35 :return: string | 35 :return: string |
36 """ | 36 """ |