From: Todd Benson Date: 2009-05-07T03:12:14+09:00 Subject: Re: Base62 encoding/decoding On Wed, May 6, 2009 at 11:32 AM, Martin DeMello wrote: > > it's definitely possible, just inefficient. first you set up your lookup table: > >> digits = (0..9).to_a.map(&:to_s) + ("a".."z").to_a + ("A".."Z").to_a >> > > then you repeatedly find the lowest digit > >> out = "" >> while n > 0 >> rest, units = n.divmod(62) >> out = digits[units] + out >> n = rest >> end > > martin > > Isn't that just a simple cipher (i.e. map)? I must be missing something. According to what I've read so far, base64 is not, and base62 is, except for that paper written in a scientific journal that I don't have access to (but, for the summary, of course). I suppose that is what the OP wanted anyway. Todd