Narks
Vastly intelligent whale-like being from the stars
- Reaction score
- 90
Does anyone know of a snippet where you can add two strings (lets say a constant and a player's name) to get a new string through some kind of shifting or something - and the reverse operation, where you subtract a player's name from a string to get the original string?
I don't know much about encryption... :x
EDIT: Okay, I'll be less lazy - if I wanted to do this, I'd convert a string to an array of integers using a character map, then I'd convert the player's name to an array of integers using a character map, then I'd... sum up the player's name to get a total, and then add it to every character in the string, then divide each character by the size of the character map to get the remainder of each character, then convert the remainder of each character to a string.
For the reverse operation, I'd convert the string to an integer array, subtract the total of the name, then do the same divison / remainder stuff...
Is this right?
I don't know much about encryption... :x
EDIT: Okay, I'll be less lazy - if I wanted to do this, I'd convert a string to an array of integers using a character map, then I'd convert the player's name to an array of integers using a character map, then I'd... sum up the player's name to get a total, and then add it to every character in the string, then divide each character by the size of the character map to get the remainder of each character, then convert the remainder of each character to a string.
For the reverse operation, I'd convert the string to an integer array, subtract the total of the name, then do the same divison / remainder stuff...
Is this right?