Sign in to follow this  
Followers 0
nullschritt

base conversion help

2 posts in this topic

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)

Share this post


Link to post
Share on other sites



Hi.

What does your array $text look like?

What for do you need this stuff? (further processing?)

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
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
Sign in to follow this  
Followers 0