serialize function

String serialize(
  1. String hex
)

Implementation

String serialize(String hex) {
  /// Here the hexadecimal value is first checked if it has 8 digits, if not a 0 is added in front and then rotated.
  String newHex = isNotEven(hex);
  List list = [
    for (int a = hex.length; a > 0; a -= 2) newHex.substring(a - 2, a)
  ];
  String hexTurn = list.join();

  return hexTurn;
}