Skip to Content
밑바닥부터 시작하는 비트코인
book

밑바닥부터 시작하는 비트코인

by 류정필, 송재준
November 2019
Beginner to intermediate
408 pages
9h 29m
Korean
Hanbit Media, Inc.
Content preview from 밑바닥부터 시작하는 비트코인
밑바닥부터 시작하는 비트코인
278
>>> hashes = [bytes.fromhex(x) for x in hex_hashes]
>>> if len(hashes) % 2 == 1:
... hashes.append(hashes[-1])
>>> parent_level = []
>>> for i in range(0, len(hashes), 2):
... parent = merkle_parent(hashes[i], hashes[i+1])
... parent_level.append(parent)
>>> for item in parent_level:
... print(item.hex())
8b30c5ba100f6f2e5ad1e2a742e5020491240f8eb514fe97c713c31718ad7ecd
7f4e6f9e224e20fda0ae4c44114237f97cd35aca38d83081c9bfd41feb907800
3ecf6115380c77e8aae56660f5634982ee897351ba906a6837d15ebc3a225df0
hashes
의 항목 수를 짝수로 만들기 위해 리스트의 마지막 해시값
hashes
[-
1
]
hashes
리스트의 끝에 추가합니다.
i
2
의 배수로 루프를 만듭니다. 즉, 처음에는
0
이고 두 번째 루프에서는
2
, 세 번째 루프
에서는
4
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

밑바닥부터 시작하는 딥러닝

밑바닥부터 시작하는 딥러닝

사이토 고키
실리콘밸리 리더십

실리콘밸리 리더십

김정혜, 마이클 롭

Publisher Resources

ISBN: 9791162248294