rot47
The rot47 tag encodes and decodes text by shifting ASCII characters 47 positions.
Created by: hackvertor
Installed 1 times
Category: Encrypt
Created on: Monday, October 21, 2024 at 8:38:35 PM
Updated on: Sunday, November 3, 2024 at 12:07:01 PM
Tag arguments
[]
Code
class rot47 {
encode(input) {
return input.replace(/[!-~]/g, (char) => {
return String.fromCharCode(((char.charCodeAt(0) - 33 + 47) % 94) + 33);
});
}
}