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

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

by 류정필, 송재준
November 2019
Beginner to intermediate
408 pages
9h 29m
Korean
Hanbit Media, Inc.
Content preview from 밑바닥부터 시작하는 비트코인
6
스크립트
169
length = len(cmd)
if length < 75:
result += int_to_little_endian(length, 1)
elif length > 75 and length < 0x100:
result += int_to_little_endian(76, 1)
result += int_to_little_endian(length, 1)
elif length >= 0x100 and length <= 520:
result += int_to_little_endian(77, 1)
result += int_to_little_endian(length, 2)
else:
raise ValueError('too long an cmd')
result += cmd
return result
def serialize(self):
result = self.raw_serialize()
total = len(result)
return encode_varint(total) + result
명령어가 정숫값이라면 이는 연산자의 오피코드를 의미합니다.
만약 길이가
1
~
75
범위라면 그 길이를
1
바이트로 표현합니다.
길이가
76
~
255
범위라면 먼저
OP
_
PUSHDATA1
을 삽입합니다. 그리고
1
바이트로 그 길이
를 표현합니다. ...
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