From: Robert Dober Date: 2009-07-06T22:17:33+09:00 Subject: Re: String conversion, from a base to an other new one On 7/6/09, Zangief Ief 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: "ù=*$`^~£" chars)? 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") => "dfedeeehdfhheefh" HTH Robert -- Toutes les grandes personnes ont d’abord été des enfants, mais peu d’entre elles s’en souviennent. All adults have been children first, but not many remember. [Antoine de Saint-Exupéry]