6 kyu
Basic Encryption
797 of 3,306Tandyman
Description:
The most basic encryption method is to map a char to another char by a certain math rule. Because every char has an ASCII value, we can manipulate this value with a simple math expression. For example 'a' + 1 would give us 'b', because 'a' value is 97 and 'b' value is 98.
You will need to write a method which does exactly that -
get a string as text and an int as the rule of manipulation, and should return encrypted text. for example:
encrypt("a",1) = "b"
Full ascii table is used on our question (256 chars) - so 0-255 are the valid values.
If the value exceeds 255, it should 'wrap'. ie. if the value is 345 it should wrap to 89.
Good luck.
Mathematics
Strings
Ciphers
Similar Kata:
Stats:
Created | Dec 27, 2016 |
Published | Dec 27, 2016 |
Warriors Trained | 6145 |
Total Skips | 583 |
Total Code Submissions | 26968 |
Total Times Completed | 3306 |
Java Completions | 649 |
JavaScript Completions | 797 |
C++ Completions | 916 |
Python Completions | 773 |
Swift Completions | 96 |
C# Completions | 153 |
F# Completions | 42 |
Total Stars | 107 |
% of votes with a positive feedback rating | 87% of 675 |
Total "Very Satisfied" Votes | 525 |
Total "Somewhat Satisfied" Votes | 118 |
Total "Not Satisfied" Votes | 32 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |