Installing

dependencies:
  convert_hex: ^0.1.7

Example

import 'package:convert_hex/convert_hex.dart';

void main() {
    Hex.decode("2BB9"); //11193
    Hex.decode("1aef2"); //110322

    Hex.encode(2019); //7E3
    Hex.encode(78895); //1342F

    //charDecode => String a-f,A-F
    Hex.charDecode("f"); //15
    Hex.charDecode("A"); //10
    Hex.charDecode("2"); //2
    Hex.charDecode("h"); //null
    
    //charEncode => int 10-15
    Hex.charEncode(10); //A
    Hex.charEncode(3); //3
    Hex.charEncode(-1); //null
    Hex.charEncode(16); //null
    Hex.charEncode(50); //null
    
    //how to use class Hex64
    
    Hex64.decode('Ba'); //90
    
    var convert = Hex64.encode(90,2);//StatusEncode
    convert.isSucceed;//true
    convert.value;//Ba
    
    convert = Hex64.encode(90,1);//StatusEncode
    convert.isSucceed;//false
    convert.value;//Ba
    
    convert = Hex64.encode(90,5);//StatusEncode
    convert.isSucceed;//true
    convert.value;//AAABa
    

}

Libraries

convert_hex