ngskicker Posted February 23, 2010 Share Posted February 23, 2010 (edited) i have this code Func ($Binary) $Decimal = 0 For $i = 1 To StringLen($Binary) $Decimal = 2^($i-1) * StringMid($Binary, StringLen($Binary)+1-$i,1) + $Decimal Next Return $Decimal EndFunc to convert binary number to decimal and this code Func DecConvert($Decimal) $n = "" $Symbols = "123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" While $Decimal > 61 $m = Mod($Decimal ,63) $m = StringMid($Symbols,$m,1) $n = $m & $n $Decimal = int($Decimal / 62) WEnd If $Decimal > 9 Then $Decimal = StringMid($Symbols,$Decimal,1) EndIf Return($Decimal & $n) EndFunc to convert Decimal to base 62 can someone help me to cobine 2 process above, instead of convert to decimal then convert to base 62 also maybe someone can give the code to convert it back from base 62 to binary Edited February 23, 2010 by ngskicker Link to comment Share on other sites More sharing options...
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 account
Already have an account? Sign in here.Sign In Now