Last active
March 8, 2024 05:37
-
-
Save hmmhmmhm/d8d9af67a6aa9e34781dbbabfa067971 to your computer and use it in GitHub Desktop.
Random Numbers Broadcasting by GPT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
encodeText
input
(Type:string
)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 theencodingTable
, it is included in the output unchanged.Potential Applications
This encoding function can be used in various scenarios, such as:
Available Audiences
All other GPT-like LLMs that use https://github.com/openai/tiktoken as a torrentizer