encryptWordBinary function

String encryptWordBinary(
  1. int factor,
  2. String word
)

a binary number sequence. These binary numbers are a multiple of the corresponding letter's position in the alphabet.

Implementation

String encryptWordBinary(int factor, String word) {
  List<String> encryptedChars = [];
  List<String> charList = word.split('');
  for (var i = 0; i < charList.length; i++) {
    String result = encryptLetterBinary(factor, charList[i]).toString();
    encryptedChars.add(result);
  }
  String newlyEncryptedString = encryptedChars.join('|');
  return newlyEncryptedString;
}