https://github.com/milio48/nk26
NKosec Encode, 2 side encode. change alphabet to numeric or back numeric to alphabet.
https://github.com/milio48/nk26
Last synced: 19 days ago
JSON representation
NKosec Encode, 2 side encode. change alphabet to numeric or back numeric to alphabet.
- Host: GitHub
- URL: https://github.com/milio48/nk26
- Owner: milio48
- License: gpl-3.0
- Created: 2018-07-06T21:10:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-03T19:56:47.000Z (2 months ago)
- Last Synced: 2025-02-03T20:34:51.877Z (2 months ago)
- Language: PHP
- Homepage:
- Size: 1.01 MB
- Stars: 5
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-termux-hacking - nk26 - NKosec Encode, 2 side encode. change alphabet to numeric or back numeric to alphabet..[](https://github.com/milio48/nk26/stargazers/) (Uncategorized / Uncategorized)
README
# nk26
Nkosec Encode, 2 side encode. change alphabet to numeric or back numeric to alphabet.### nk26 logic
![]()
- focused on alphanumeric, use a simple logic str_replace.
- this logic is made, when I make a challenge for a friend in a detective game.### php example
```
{
const index = a.indexOf(char);
return index !== -1 ? b[index] : char;
}).join('');
}function nk26_decode(data) {
const replacements = [
{ from: ['1112', '1113', '0'], to: ['y', 'z', ' '] },
{ from: ['112', '113', '114', '115', '116', '117', '118', '119'], to: ['q', 'r', 's', 't', 'u', 'v', 'w', 'x'] },
{ from: ['12', '13', '14', '15', '16', '17', '18', '19'], to: ['i', 'j', 'k', 'l', 'm', 'n', 'o', 'p'] },
{ from: ['2', '3', '4', '5', '6', '7', '8', '9'], to: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] }
];replacements.forEach(replacement => {
replacement.from.forEach((item, index) => {
data = data.split(item).join(replacement.to[index]);
});
});return data;
}// Example
const encoded = nk26_encode("HELLO THERE".toLowerCase());
console.log(encoded); // Output: 961515180115961136const decoded = nk26_decode("961515180115961136");
console.log(decoded); // Output: hello there
```