Name

encode_b32_num, decode_b32_num — encode/decode integers in RFC4648 (base32) alphabet

Synopsis

encode_b32_num ( in i integer);
 
integer decode_b32_num( in s varchar);
 

Parameters

s

A varchar value in RFC4648 alphabet to be converted to an integer.

i

A integer value to be encoded.

Return Values

encode_b32_num returns a varchar encoding of its input value. decode_b32_num returns an integer value obtained by decoding its input.

Description

These functions can be used to shorten IDs or other potentially large numbers for human input/output by converting them to base32 encoding using the RFC4648 base32 alphabet. This alphabet uses only upper case characters A-Z and numbers 2-7 (0 and 1 are eliminated so they won't be confused with the characters O and I, respectively.)

Examples

Example 24.103. Simple Example

Shorten an integer

SQL> select encode_b32_num (4711666);
callret
VARCHAR
_______________________________________________________________________________

EPZHS

1 Rows. -- 0 msec.


© 1992 - OpenLink Software. All rights reserved.

Making Technology Work for You®