Converts an array representation of a number to a string.
More precisely, the elements of the input array are indices into the base,
which is represented as a string, which can either be user defined or one of
the BASE_xxx constants.
Throws an Error if the number contains a digit which is outside the range
0 ... base.length - 1.
|
code » | |
Converts a number from one numeric base to another.
The bases are represented as strings, which list allowed digits. Each digit
should be unique. The bases can either be user defined, or any of
goog.crypt.baseN.BASE_xxx.
The number is in human-readable format, most significant digit first, and is
a non-negative integer. Base designators such as $, 0x, d, b or h (at end)
will be interpreted as digits, so avoid them. Leading zeros will be trimmed.
Note: for huge bases the result may be inaccurate because of overflowing
64-bit doubles used by JavaScript for integer calculus. This may happen
if the product of the number of digits in the input and output bases comes
close to 10^16, which is VERY unlikely (100M digits in each base), but
may be possible in the future unicode world. (Unicode 3.2 has less than 100K
characters. However, it reserves some more, close to 1M.)
|
code » | |
Converts a string representation of a number to an array of digit values.
More precisely, the digit values are indices into the number base, which
is represented as a string, which can either be user defined or one of the
BASE_xxx constants.
Throws an Error if the number contains a digit not found in the base.
|
code » |
![]()
The more-known version of the BASE-64 encoding. Uses + and / characters.
|
Code » | |
![]()
URL-safe version of the BASE-64 encoding.
|
Code » | |
![]()
Base-2, i.e. '01'.
|
Code » | |
![]()
Base-10, i.e. '0123456789'.
|
Code » | |
![]()
Base-16 using lower case, i.e. '0123456789abcdef'.
|
Code » | |
![]()
Base-8, i.e. '01234567'.
|
Code » | |
![]()
Base-16 using upper case, i.e. '0123456789ABCDEF'.
|
Code » |