티스토리 뷰

Programming/python

python hashlib

RosyPark 2019. 10. 4. 21:19

0. hashlib 

 

1. 예제 

1
2
3
4
5
6
7
import json
import hashlib
 
block = {'index'1'timestamp'1570176533.2550528'transactions': [], 'proof'100'previous_hash ''1'}
block_string = json.dumps(block,sort_keys = True).encode()
print(hashlib.sha256(block_string).hexdigest())
 
cs

>> d9360c4ec2b62490970a360964e32f21299c52c29be7e9f46d1787af7cc31c82

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG more
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함