redndahead Posted January 19, 2004 Share Posted January 19, 2004 I see there is a way of turning Decimal to Hex. Is there a way to turn it back from Hex to Decimal? red Link to comment Share on other sites More sharing options...
tylo Posted January 19, 2004 Share Posted January 19, 2004 (edited) Not built in, but you can feed the string from Hex() back into this func: 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 January 20, 2004 by tylo blub Link to comment Share on other sites More sharing options...
Administrators Jon Posted January 19, 2004 Administrators Share Posted January 19, 2004 I should make that built in really. This list is getting longer. Arrgrgh. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
redndahead Posted January 19, 2004 Author Share Posted January 19, 2004 Thanks Tylo that was exactly what i needed... I would appreciate it jon that will cut out some unnecessary code. Thanks everybody again. Give my password encryption program a try. red Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now