mirror of
https://github.com/elder-plinius/P4RS3LT0NGV3.git
synced 2026-05-26 01:47:51 +02:00
dc10a90851
- Implement tool registry system with individual tool modules - Reorganize transformers into categorized source modules - Remove emojiLibrary.js, consolidate into EmojiUtils and emojiData - Fix mobile close button and tooltip functionality - Add build system for transforms and emoji data - Migrate from Python backend to pure JavaScript - Add comprehensive documentation and testing - Improve code organization and maintainability - Ignore generated files (transforms-bundle.js, emojiData.js)
27 lines
870 B
JavaScript
27 lines
870 B
JavaScript
// rot47 transform
|
|
import BaseTransformer from '../BaseTransformer.js';
|
|
|
|
export default new BaseTransformer({
|
|
|
|
name: 'ROT47',
|
|
priority: 60,
|
|
func: function(text) {
|
|
return [...text].map(c => {
|
|
const code = c.charCodeAt(0);
|
|
// ROT47 operates on ASCII 33-126 (94 chars), rotating by 47 (half of 94)
|
|
// This makes ROT47 self-inverse (encoding = decoding)
|
|
if (code >= 33 && code <= 126) {
|
|
return String.fromCharCode(33 + ((code - 33 + 47) % 94));
|
|
}
|
|
return c;
|
|
}).join('');
|
|
},
|
|
preview: function(text) {
|
|
return this.func(text);
|
|
},
|
|
reverse: function(text) {
|
|
// ROT47 is self-inverse, so reverse is the same as forward
|
|
return this.func(text);
|
|
}
|
|
|
|
}); |