mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 07:18:47 +00:00
Merge pull request #804 from PR0M3TH3AN/codex/modify-hex_to_bech32-for-padding
Enable padding for hex_to_bech32 conversion
This commit is contained in:
@@ -27,7 +27,8 @@ class Keys:
|
||||
|
||||
@staticmethod
|
||||
def hex_to_bech32(key_str: str, prefix: str = "npub") -> str:
|
||||
data = convertbits(bytes.fromhex(key_str), 8, 5)
|
||||
# Pad to align with 5-bit groups as expected for Bech32 encoding
|
||||
data = convertbits(bytes.fromhex(key_str), 8, 5, True)
|
||||
return bech32_encode(prefix, data)
|
||||
|
||||
@staticmethod
|
||||
|
Reference in New Issue
Block a user