decryptWordBinary function

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

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

Implementation

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