-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a new implementation for the p2pkh verification, which is more readable and should be similar to other scriptpubkey_type types.
- Loading branch information
1 parent
623a3cc
commit 13f121c
Showing
4 changed files
with
224 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
import hashlib | ||
import os | ||
|
||
def get_filename_without_extension(file_path): | ||
# Get the base filename from the path | ||
filename = os.path.basename(file_path) | ||
# Remove the extension | ||
filename_without_extension = os.path.splitext(filename)[0] | ||
return filename_without_extension | ||
return filename_without_extension | ||
|
||
def decode_hex(hex_data): | ||
# Decode a hex-encoded data into its raw bytecode. | ||
return bytes.fromhex(hex_data) | ||
|
||
def hash160(data): | ||
# SHA-256 followed by RIPEMD-160 (Bitcoin's HASH160). | ||
sha256_hash = hashlib.sha256(data).digest() | ||
return hashlib.new('ripemd160', sha256_hash).digest() |
Oops, something went wrong.