Skip to content

Commit

Permalink
added fix_hex method
Browse files Browse the repository at this point in the history
  • Loading branch information
futzu authored Jan 14, 2024
1 parent f7c8f26 commit ae8155f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions threefive/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def as_hms(secs_of_time):
output += "0"
return output

def fix_hex(hexed):
"""
fix_hex adds padded zero if needed for byte conversion.
"""
return (hexed.replace('0x','0x0',1),hexed)[len(hexed) %2 == 0]

def get(self):
"""
Returns instance as a dict
Expand Down

0 comments on commit ae8155f

Please sign in to comment.