Search Postgresql Archives

Re: convert very large unsigned numbers to base62?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 14 May 2008, D. Dante Lorenso wrote:

Stuart Cooper wrote:
base 62 is cruel and unusual punishment. Introduce two more printing
characters to your set a..z, A..Z, 0..9 such as "_" and "!" and do it in base 64
instead.

I thought about adding 2 more characters, but I didn't like anything that was on my keyboard

You really should use as much of an existing wheel here as possible rather than completely reinventing one:

http://en.wikipedia.org/wiki/Base64

The standard additional two characters to add are "+/".

My original question is more along the lines of trying to see if there were built-in functions in PostgreSQL that already do this type of base conversion.

http://www.postgresql.org/docs/current/static/functions-string.html shows an encode and decode pair that can use base64, you may be able to leverage those here.

--
* Greg Smith gsmith@xxxxxxxxxxxxx http://www.gregsmith.com Baltimore, MD


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux