public string Encode(string word) { if (String.IsNullOrEmpty(word)) { return("0000"); } if (word.Length == 1) { return(String.Format(word + "000")); } if (word.Any(x => !char.IsLetter(x))) { return("0000"); } string lowerCaseWord = word.ToLower(); string encodedWord = _algorithm.EncodeWord(lowerCaseWord); encodedWord = EncodeWord(lowerCaseWord); TrimString(ref encodedWord); return(encodedWord); }