Hex to Decimal
Posted 19 January 2004 - 06:16 PM
Posted 19 January 2004 - 07:31 PM
Func Hex2Dec($number) $len = StringLen($number) $number = StringUpper($number) $ret = 0 $fac = 1 For $i = $len To 1 Step -1 $n = Asc(StringMid($number, $i, 1)) - 48 If $n > 9 Then $n = $n - 7 $ret = $ret + ($n * $fac) $fac = $fac * 16 Next Return $ret EndFunc
/EDIT: removed use of ^ operator: Jon, this is straight forward to do in C.
Edited by tylo, 20 January 2004 - 07:02 AM.
Posted 19 January 2004 - 10:48 PM
I would appreciate it jon that will cut out some unnecessary code.
Thanks everybody again. Give my password encryption program a try.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users