mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-30 09:22:03 +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:
1 file changed
+2
-1
@@ -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