Mercurial > public > bitcaviar-plus
comparison src/bitcaviar_plus/helpers.py @ 28:30535f42d0ff
refactor code
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Wed, 02 Feb 2022 21:16:10 +0100 |
parents | 6a0a8cce058e |
children |
comparison
equal
deleted
inserted
replaced
27:348a07008703 | 28:30535f42d0ff |
---|---|
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 """ |