Jump to content

base conversion help


Recommended Posts

I am having some trouble in my code, I am able to convert the text to my base104, however I am unsure how to convert it back, it seems to become corrupted when I do so, perhaps I am doing something wrong?

the original udf is here ->

The code to convert:

Global $base104 = "H¦,He,Li,Be,B¦,C¦,N¦,O¦,F¦,Ne,Na,Mg,Al,Si,P¦,S¦,Cl,Ar,K¦,Ca,Sc,Ti,Cr,Mn,Fe,Co,Ni,Cu,Zn,Ga,Ge,As,Se,Br,Kr,Rb,Sr,Y¦,Zr,Nb,Mo,Tc,Ru,Rh,Pd,Ag,Cd,In,Sn,Sb,Te,I¦,Xe,Cs,Ba,La,Ce,Pr,Nd,Pm,Sm,Eu,Gd,Tb,Dy,Ho,Er,Tm,Yb,Lu,Hf,Ta,W¦,Re,Os,Ir,Pt,Au,Hg,Tl,Pb,Bi,Po,At,Rn,Fr,Ra,Ac,Th,Pa,U¦,Np,Pu,Am,Cm,Bk,Cf,Es,Fm,Md,No,Bh,Rg,Fl"
for $i=1 to $text[0]
$number &= _Base(AscW($text[$i]), $base104)
Next

The code to convert it back:

$string = StringSplit($string, "")
$text = ""
for $i=1 to $string[0] step 2
$text &= _dec($string[$i]&$string[$i+1], $base104)
Next

(I do not know what to do with the numbers returned from _dec)

Link to comment
Share on other sites

  • 4 weeks later...

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...