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

Function xorEncode

7.GraphQL Apocalypse/server/crypto/flagEncoder.ts:13–18  ·  view source on GitHub ↗
(str: string, key: number)

Source from the content-addressed store, hash-verified

11}
12
13function xorEncode(str: string, key: number): string {
14 return str
15 .split('')
16 .map((char) => String.fromCharCode(char.charCodeAt(0) ^ key))
17 .join('');
18}
19
20export function encodeFlag(flag: string): string {
21 const step1 = rot13(flag);

Callers 2

encodeFlagFunction · 0.85
decodeFlagFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected