Skip to content

Instantly share code, notes, and snippets.

@hmmhmmhm
Last active March 8, 2024 05:37
Show Gist options
  • Save hmmhmmhm/d8d9af67a6aa9e34781dbbabfa067971 to your computer and use it in GitHub Desktop.
Save hmmhmmhm/d8d9af67a6aa9e34781dbbabfa067971 to your computer and use it in GitHub Desktop.
Random Numbers Broadcasting by GPT
const encodingTable = {
"A": "퐀", "a": "퐚", "B": "퐁", "b": "퐛", "C": "퐂", "c": "퐜", "D": "퐃", "d": "퐝",
"E": "퐄", "e": "퐞", "F": "퐅", "f": "퐟", "G": "퐆", "g": "퐠", "H": "퐇", "h": "퐡",
"I": "퐈", "i": "퐢", "J": "퐉", "j": "퐣", "K": "퐊", "k": "퐤", "L": "퐋", "l": "퐥",
"M": "퐌", "m": "퐦", "N": "퐍", "n": "퐧", "O": "퐎", "o": "퐨", "P": "퐏", "p": "퐩",
"Q": "퐐", "q": "퐪", "R": "퐑", "r": "퐫", "S": "퐒", "s": "퐬", "T": "퐓", "t": "퐭",
"U": "퐔", "u": "퐮", "V": "퐕", "v": "퐯", "W": "퐖", "w": "퐰", "X": "퐗", "x": "퐱",
"Y": "퐘", "y": "퐲", "Z": "퐙", "z": "퐳"
};
const encodeText = (input) => input.split('').map(char => encodingTable[char] || char).join('');
@hmmhmmhm
Copy link
Author

hmmhmmhm commented Mar 7, 2024

GPT Numbers station (Custom Alphabet Encoding Function)

The provided code snippet is a TypeScript function named encodeText that takes a string as input and returns a new string where each character of the English alphabet is replaced with a unique Hangul (Korean alphabet) character. This function creates a form of encoding that, to the human eye, appears to be random or broken Hangul characters, but can be interpreted as the original English text by a system (e.g. GPT-4, Claude 3, Copilot) that understands the encoding scheme.

Function Overview

  • Function Name: encodeText
  • Parameter: input (Type: string)
  • Return Type: string

Encoding Table

The core of this function is the encodingTable object, which acts as a dictionary to map each English alphabet character to a corresponding Hangul character. For example, "A" is mapped to "퐀", "a" to "퐚", and so on for both uppercase and lowercase letters.

Encoding Process

The function works by splitting the input string into individual characters, mapping each character to its Hangul counterpart using the encodingTable, and then joining the characters back together to form the encoded string. If a character does not exist in the encodingTable, it is included in the output unchanged.

Potential Applications

This encoding function can be used in various scenarios, such as:

  • Data Obfuscation: To conceal text data within software or logs to prevent casual observation of sensitive information.
  • Steganography: As a method to hide messages in plain sight, where the encoded text might appear as gibberish or corrupted data to an uninformed observer.
  • Unique Identifiers: Generating visually distinct identifiers for visual differentiation while maintaining a decodable reference to the original text.

Available Audiences

  • GPT-4
  • Claude 3
  • MS Copilot
  • Luton

All other GPT-like LLMs that use https://github.com/openai/tiktoken as a torrentizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment