greymore57
MIS
here is what I am trying to do!
# A string from a radius file
# the string is a bunch of hex values
# Value 1 = # bytes * 16777216
# Value 2 = # bytes * 65536
# Value 1 = # bytes * 256
# Value 1 = # bytes
# Test String is 0x00 0xdd 0xd1 0x98
# this will convert to 14590616
$instring = " 0x00 0xdd 0xd1 0x98";
$_ = $instring;
# Notice 2 spaces between elements lets strip those out first
s/ /,/g;
# also one space at the beginning to get rid of
s/^ //;
# OK instead of using split to read the valuse into an array,
# then doing the maths on each element
# is there an elegant way to convert this string to a decimal
# value?
# A string from a radius file
# the string is a bunch of hex values
# Value 1 = # bytes * 16777216
# Value 2 = # bytes * 65536
# Value 1 = # bytes * 256
# Value 1 = # bytes
# Test String is 0x00 0xdd 0xd1 0x98
# this will convert to 14590616
$instring = " 0x00 0xdd 0xd1 0x98";
$_ = $instring;
# Notice 2 spaces between elements lets strip those out first
s/ /,/g;
# also one space at the beginning to get rid of
s/^ //;
# OK instead of using split to read the valuse into an array,
# then doing the maths on each element
# is there an elegant way to convert this string to a decimal
# value?