Update ciphers/monoAlphabeticCipher.php cipher function

Co-authored-by: Brandon Johnson <bbj1979@gmail.com>
This commit is contained in:
YvonneChong18 2022-07-27 18:50:30 +08:00 committed by GitHub
parent d75ccafe73
commit 6b961bce3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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