MCPcopy Create free account
hub / github.com/F12FLASH/CTF / rot13

Function rot13

7.GraphQL Apocalypse/server/crypto/flagEncoder.ts:1–7  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

1function rot13(str: string): string {
2 return str.replace(/[a-zA-Z]/g, (char) => {
3 const code = char.charCodeAt(0);
4 const base = code >= 97 ? 97 : 65;
5 return String.fromCharCode(((code - base + 13) % 26) + base);
6 });
7}
8
9function rot13Reverse(str: string): string {
10 return rot13(str);

Callers 2

rot13ReverseFunction · 0.85
encodeFlagFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected