The constructor of the BaseFormatter
class.
A string of symbols for representing the digits, the length of which determining the base number.
Optional parameters, for adjusting conversion rules and the encoding output string formatting.
Readonly
baseThe base number
Readonly
digitsThe digits to use.
Readonly
propertiesThe properties of the class, set by the options of the constructor
Decode an en encoded number according to the instance base and specified digits and properties.
DigitNotFound
when the specified string contains unknown characters.
An encoded number as a string in the instance base.
Optional
options: BaseFormatterOptionsThe options to use if, for example, alternative characters were specified during encoding.
The decoded number.
Encodes the specified number according to the instance base and specified digits and properties.
The number to encode, as a number, string or Decimal type.
Optional
options: BaseFormatterOptionsThe options to use for formatting.
the encoded number as a string.
Static
base57This method returns an instance of the BaseFormatter
class in base 57 with the digits 0-9A-Ba-b without the characters Il1O0.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
base58This method returns an instance of the BaseFormatter
class in base 58 with the digits 0-9A-Ba-b without the characters IlO0.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
base62This method returns an instance of the BaseFormatter
class in base 62 with the digits 0-9A-Ba-b.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
binaryThis method returns an instance of the BaseFormatter
class in base 2 with the digits '01'
.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
byThis method will take the base number, slice a string of digits 0-9A-Za-z to a length equal to the base number
and return an instance of the BaseFormatter
class with the sliced string as the digits.
MaximumBaseExceeded
when the base number exceeds the maximum amount of this method.
The base number to use, a maximum of 62
.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
cuneiformThis method returns an instance of the BaseFormatter
class in base 60 using cuneiform digits.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
decimalThis method returns an instance of the BaseFormatter
class in base 10 with the digits '0123456789'
.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
dominoThis method returns an instance of the BaseFormatter
class in base 98 using Unicode domino tiles.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
dozenalThis method returns an instance of the BaseFormatter
class in base 12 with the digits '0123456789↊↋'
and the radix character of ';'
.
The digits ↊ and ↋ as used by the Dozenal Societies of America and Great Britain.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
dozenalThis method returns an instance of the BaseFormatter
class in base 12 with the digits '0123456789TE'
and the radix character of ';'
.
The digits T and E are the ASCII variations of the digits ↊ and ↋ used by the BaseFormatter.dozenal
method in case a font doesn't have them.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
dozenalThis method returns an instance of the BaseFormatter
class in base 12 with the digits '0123456789XE'
and the radix character of ';'
.
Uses a variant of the digit for 10 using the Roman numeral X.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
duodecimalThis method returns an instance of the BaseFormatter
class in base 12 with the digits '0123456789AB'
.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
hexadecimalThis method returns an instance of the BaseFormatter
class in base 16 with the digits '0123456789ABCDEF'
.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
octalThis method returns an instance of the BaseFormatter
class in base 8 with the digits '01234567'
.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
sexagesimalThis method returns an instance of the BaseFormatter
class in base 60 with the digits 0-9A-Ba-b without the characters l0.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Static
vigesimalThis method returns an instance of the BaseFormatter
class in base 20 with the digits '0123456789ABCDEFGHJK'
,
skipping over I in order to avoid confusion between I and 1.
Optional
options: BaseFormatterOptionsThe options to use.
An instance of the BaseFormatter
class.
Generated using TypeDoc
The class from which to create a
BaseFormatter
instance for encoding to a string format from specified digits.