On 01.11.2010 20:27, Intransition wrote:
> Is there a standard encoding for base62? I've been using 0..9a..zA..Z,
> but I think I should switch that to 0..9A..Za..z, so it would sort
> properly according to ASCII order. I wasn't able to find anything on a
> standard via a Google search. So maybe there just isn't one?
>
> I was kind of surprised to see Ruby uses lower case a..f for
> hexadecimal rather than uppercase.
>
>    "255.to_s(16)  #=>  "ff"

irb(main):003:0> "0x%02X" % 255
=> "0xFF"

I have no idea though, why you want to use Base62 encoding when there is 
a standard implementation of Base64 encoding.

irb(main):005:0> require 'base64'
=> true
irb(main):006:0> Base64.encode64 "\000\001"
=> "AAE=\n"

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/