Files
P4RS3LT0NGV3/src/transformers/cipher/rot5.js
T
Dustin Farley dc10a90851 refactor: migrate to modular tool-based architecture
- 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)
2025-12-02 20:26:32 -08:00

26 lines
751 B
JavaScript

// rot5 transform
import BaseTransformer from '../BaseTransformer.js';
export default new BaseTransformer({
name: 'ROT5',
priority: 60,
func: function(text) {
return [...text].map(c => {
if (c >= '0' && c <= '9') {
const n = c.charCodeAt(0) - 48;
return String.fromCharCode(48 + ((n + 5) % 10));
}
return c;
}).join('');
},
preview: function(text) {
if (!text) return '[rot5]';
return this.func(text.slice(0, 6)) + (text.length > 6 ? '...' : '');
},
reverse: function(text) {
// ROT5 is its own inverse
return this.func(text);
}
});