https://github.com/0xlet/rotx
🔄 Swift+ROT13
https://github.com/0xlet/rotx
rot13 rotx string swift
Last synced: about 2 months ago
JSON representation
🔄 Swift+ROT13
- Host: GitHub
- URL: https://github.com/0xlet/rotx
- Owner: 0xLet
- License: mit
- Created: 2021-01-14T01:41:35.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-14T01:45:53.000Z (over 4 years ago)
- Last Synced: 2025-02-07T18:19:29.197Z (4 months ago)
- Topics: rot13, rotx, string, swift
- Language: Swift
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ROTx
*[ROT13](https://en.wikipedia.org/wiki/ROT13) with a shift*
```swift
"Hello, World!".rot13() // Uryyb, Jbeyq!"Uryyb, Jbeyq!".rot13() // Hello, World!
```
## String+ROTx### shifted
```swift
"abcdefghijklmnopqrstuvwxyz".shifted(by: 1) // bcdefghijklmnopqrstuvwxyza"abcdefghijklmnopqrstuvwxyz".shifted(by: 0) // abcdefghijklmnopqrstuvwxyz
"abcdefghijklmnopqrstuvwxyz".shifted(by: -1) // zabcdefghijklmnopqrstuvwxy
```### rot13
```swift
"abcdefghijklmnopqrstuvwxyz".rot13() // nopqrstuvwxyzabcdefghijklm"nopqrstuvwxyzabcdefghijklm".rot13() // abcdefghijklmnopqrstuvwxyz
```