number_converter

Last updated:

0 purchases

number_converter Image
number_converter Images
Add to Cart

Description:

number converter

number_converter #
A library to convert decimal numbers into or from another number system
Initialize a number converter #
You can create a number converter with a custom alphabet:
NumberConverter converter = NumberConverter('0123456789ABCDEF'); //Uppercased hexadecimal
copied to clipboard
You can also use some predefined number systems:
NumberConverter converter = NumberConverter.system(NumberSystem.binary); /// Base 2
NumberConverter converter = NumberConverter.system(NumberSystem.octal); /// Base 8
NumberConverter converter = NumberConverter.system(NumberSystem.hexadesimal); /// Base 16
NumberConverter converter = NumberConverter.system(NumberSystem.base36); /// Base 36
NumberConverter converter = NumberConverter.system(NumberSystem.base56); /// Base 58
NumberConverter converter = NumberConverter.system(NumberSystem.base62); /// Base 62
NumberConverter converter = NumberConverter.system(NumberSystem.base64); /// Base 64
copied to clipboard
Encode a decimal number to another number system: #
String encoded = converter.encode(12345);
copied to clipboard
If the encoded string should have a minimum length:
String encoded = converter.encode(12345, minLength: 5);
copied to clipboard
Decode a number: #
int decoded = converter.decode('ENCODED');
copied to clipboard
Run tests: #
dart test test/number_converter_test.dart
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.