On 7/6/09, Zangief Ief <z4n9ief / gmail.com> wrote:
> Hello,
>
> Is there a way, in Ruby, to convert this kind of value: "3m74jnfu9f"
> (which is in base 32 having: "0123456789abcdefghijklmnopqrstuv" chars)
> into a other new base, for instance a base 8 (having: "=F9=3D*$`^~=A3" ch=
ars)?
I have used abcdefgh for readability but I guess you got the idea ;)

irb(main):006:0> "3m74jnfu9f".to_i(32).to_s(8).tr("01234567","abcdefgh")
=3D> "dfedeeehdfhheefh"

HTH
Robert


--=20
Toutes les grandes personnes ont d=92abord =E9t=E9 des enfants, mais peu
d=92entre elles s=92en souviennent.

All adults have been children first, but not many remember.

[Antoine de Saint-Exup=E9ry]