Standard Base62 Encoding?

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"

Where is base 62 used?

···

On Nov 1, 1:27 pm, Intransition <transf...@gmail.com> 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

···

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"

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

Even easier, for base64, no requires needed.

ruby-1.9.2-p0 > ["\000\001"].pack("m")
=> "AAE=\n"

I'm not using it as such. My question is for my Radix project which
can convert any base to any other. 62 is the max limit for a string
representation of a number. I wanted to keep them limited to Latin
characters.

As for as base-62, from what I understand is used for basically that
same reason. Say you want to "scramble" file names, but need to make
sure they are still valid filenames. Encoding in Base-62 is good for
that.

···

On Nov 1, 6:20 pm, Robert Klemme <shortcut...@googlemail.com> wrote:

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.