decryptWordHex function

String decryptWordHex(
  1. int factor,
  2. String encryptedWord
)

This function returns a word from a sequence of hexadecimal numbers corresponding to the each letter's position in the alphabet.

Implementation

String decryptWordHex(int factor, String encryptedWord) {
  List<String> decryptedChars = [];
  List<String> charList = encryptedWord.split('|');
  for (var i = 0; i < charList.length; i++) {
    String result = decryptLetterHex(factor, charList[i]);
    decryptedChars.add(result);
  }
  String newlyDecryptedString = decryptedChars.join('');
  return newlyDecryptedString;
}