base256.py: support hex value
This commit is contained in:
parent
8e5f4e4d9e
commit
9cda0e04d8
1 changed files with 2 additions and 1 deletions
|
@ -4,7 +4,8 @@
|
||||||
from sys import argv
|
from sys import argv
|
||||||
|
|
||||||
def from_base256(number):
|
def from_base256(number):
|
||||||
num = int(number)
|
base = 16 if number.startswith('0x') else 10
|
||||||
|
num = int(number, base)
|
||||||
addr = list()
|
addr = list()
|
||||||
for e in range(3, -1, -1):
|
for e in range(3, -1, -1):
|
||||||
multiplier = 256 ** e
|
multiplier = 256 ** e
|
||||||
|
|
Loading…
Reference in a new issue