b - Base conversion

Version Build Status Coverage Status License

A Dart library for converting between different bases, e.g., decimal ↔ binary, octal ↔ hexadecimal

Usage

See example/main.dart

Decimal (emoji) ↔ Hexadecimal

final BaseConversion decimalEmojiToHexadecimalConverter = BaseConversion(
  from: '0️⃣1️⃣2️⃣3️⃣4️⃣5️⃣6️⃣7️⃣8️⃣9️⃣',
  to: '0123456789ABCDEF',
);

final String hexadecimal = decimalEmojiToHexadecimalConverter('5️⃣1️⃣9️⃣6️⃣6️⃣');
// hexadecimal == 'CAFE'

final String decimalEmoji = decimalEmojiToHexadecimalConverter.inverse()('DEADC0DE');
// decimalEmoji == '3️⃣7️⃣3️⃣5️⃣9️⃣2️⃣9️⃣0️⃣5️⃣4️⃣'

Syntax

BaseConversion({required String from, required String to})

from - String of numeral symbols representing the digits of from numeral system.

to - String of numeral symbols representing the digits of to numeral system.

See documentation for more

License

MIT

Libraries

b