mirror of
https://github.com/TheAlgorithms/PHP.git
synced 2025-01-17 07:08:13 +01:00
ciphers: some style clean-up for consistency
This commit is contained in:
parent
b2c68f1aac
commit
6c627c5589
@ -2,6 +2,7 @@
|
||||
|
||||
/**
|
||||
* Encrypt given text using caesar cipher.
|
||||
*
|
||||
* @param string text text to be encrypted
|
||||
* @param int shift number of shifts to be applied
|
||||
* @return string new encrypted text
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
/**
|
||||
* Encode text to Morse Code.
|
||||
*
|
||||
* @param string text to encode
|
||||
* @return string encoded text
|
||||
*/
|
||||
function encode(string $text): string
|
||||
{
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
/* The XOR cipher is a type of additive cipher.
|
||||
|
||||
/**
|
||||
* The XOR cipher is a type of additive cipher.
|
||||
* Each character is bitwise XORed with the key.
|
||||
* We loop through the input string, XORing each
|
||||
* character with the key.
|
||||
@ -9,7 +11,6 @@
|
||||
* @param string $key The key to use.
|
||||
* @return string The encrypted string.
|
||||
*/
|
||||
*/
|
||||
function xorCipher(string $input_string, string $key)
|
||||
{
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user