mirror of
https://github.com/TheAlgorithms/PHP.git
synced 2025-01-17 07:08:13 +01:00
Update ciphers/monoAlphabeticCipher.php cipher function
Co-authored-by: Brandon Johnson <bbj1979@gmail.com>
This commit is contained in:
parent
d75ccafe73
commit
6b961bce3f
@ -2,7 +2,8 @@
|
||||
// A mono-alphabetic cipher is a simple substitution cipher
|
||||
// https://www.101computing.net/mono-alphabetic-substitution-cipher/
|
||||
|
||||
function cipher($key, $alphabet, $text){
|
||||
function monoAlphabeticCipher($key, $alphabet, $text){
|
||||
|
||||
$cipherText = ''; // the cipher text (can be decrypted and encrypted)
|
||||
|
||||
if ( strlen($key) != strlen($alphabet) ) { return false; } // check if the text length matches
|
||||
|
Loading…
x
Reference in New Issue
Block a user