Jump to content

convert text to base 13


Recommended Posts

I ended up figuring it out for myself thanks though. And no i meant actually converting them to be base13.

Func _Base($iDecNumber, $sChar)
Local $aBase = StringSplit($sChar, ",")
Local $iBase = $aBase[0]

Local $iLen = Int(Log($iDecNumber) / Log($iBase)) + 1

Dim $iUnit[$iLen + 1]
Local $iReturn
Local $iTemp = $iDecNumber

If $aBase[0] <> $iBase Then
SetError(1)
Return -1
EndIf

If $iDecNumber = 0 Then Return $aBase[1]

For $i = 1 To $iLen
For $i2 = 1 To $i - 1
$iTemp = $iTemp / $iBase
Next
$iUnit[$i] = $aBase[Mod($iTemp, $iBase) + 1]
$iTemp = $iDecNumber
Next

For $i = 1 To $iLen
$iReturn = $iUnit[$i] & $iReturn
Next

Return $iReturn
EndFunc ;==>_Base
Link to comment
Share on other sites

Thanks but I got to work how i need to. I'm using a custom number system with unicode chars(not the ones shown here).

I'm working on a base 104 encoding that uses the base elements to represent text (molecules from the periodic table)

And I am working on a way to combine elements based on chemical bonding. To make a sort of universal base set....

Sorry about my bad english.

Link to comment
Share on other sites

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

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...