select '\x78000000000000000000000000000000'::bytea::hugebase62; hugebase62 ------------ 1w (1 row) select '1w'::hugebase62; hugebase62 ------------ 1w (1 row) select '1W'::hugebase62; hugebase62 ------------ 1W (1 row) select '3caaaaaaaaaaaaa'::hugebase62; hugebase62 ----------------- 3caaaaaaaaaaaaa (1 row) select '2LKcb1'::hugebase62; hugebase62 ------------ 2LKcb1 (1 row) select '\xffffff7f000000000000000000000000'::bytea::hugebase62; hugebase62 ------------ 2LKcb1 (1 row) select '2lkcb1'::hugebase62::bytea; bytea ------------------------------------ \xcfbe4497000000000000000000000000 (1 row) select 'AzL8n0Y58m7aa'::hugebase62; hugebase62 --------------- AzL8n0Y58m7aa (1 row) select 'azl8n0y58m7aa'::hugebase62; hugebase62 --------------- azl8n0y58m7aa (1 row) select 'AAAAAAAAAAAAAAAAAAAA'::hugebase62; hugebase62 ---------------------- AAAAAAAAAAAAAAAAAAAA (1 row) select 'aaaaaaaaaaaaaaaaaaaa'::hugebase62; hugebase62 ---------------------- aaaaaaaaaaaaaaaaaaaa (1 row) -- ERROR: out of range select 'AAAAAAAAAAAAAAAAAAAAA'::hugebase62; ERROR: value "AAAAAAAAAAAAAAAAAAAAA" is out of range for type hugebase62 LINE 1: select 'AAAAAAAAAAAAAAAAAAAAA'::hugebase62; ^ -- ERROR: not a valid digit select '3&'::hugebase62; ERROR: value "&" is not a valid digit for type hugebase62 LINE 1: select '3&'::hugebase62; ^ select 'a'::hugebase62 > 'b'::hugebase62; ?column? ---------- f (1 row) select 'a'::hugebase62 < 'b'::hugebase62; ?column? ---------- t (1 row) -- Negativity test select i::text::hugebase62, i::text::hugebase62::bytea from (values ('11111'), ('acDeq'), ('10'), ('A'), ('-1'), ('-A')) as v(i); i | i -------+------------------------------------ 11111 | \x4b2ae500000000000000000000000000 acDeq | \x28e03f20000000000000000000000000 10 | \x3e000000000000000000000000000000 A | \x0a000000000000000000000000000000 -1 | \xffffffffffffffffffffffffffffffff -A | \xf6ffffffffffffffffffffffffffffff (6 rows) -- Test values select bigbase62_encode(i)::base62 from generate_series(1, 80) g(i); bigbase62_encode ------------------ 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 1G 1H 1I (80 rows)