dougallwinship/unicodez

unicodez library

Maintainers

Package info

github.com/DougallWinship/unicodez

pkg:composer/dougallwinship/unicodez

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v0.1.0-alpha 2026-04-06 10:10 UTC

This package is auto-updated.

Last update: 2026-04-06 10:16:26 UTC


README

Encode/decode text to/from various Unicode character sets (ranges) using a seed for some reason ๐Ÿคท

For example "this is a test" encoded as Runic with a seed of 1 (using a pseudo shebang to integrate the seed number) gives: แšก๏ปฟแ›šแ›แ›–แšฐแ›กแ›‘แšฎแ›…แ›ˆแ›‰แ›กแ›‘แšฎแ›…แ›ˆแ›‰แ›Šแ›”แ›ˆแ›‰แ›šแ›แ›Ÿแ›ฉแšฎแ›…แ›šแ›

...or "Why am I looking at this project? I probably need to rethink my priorities." encoded with Flags and a seed of 13 (without a pseudo-shebang) results in:
๐Ÿ‡น๐Ÿ‡ด๐Ÿ‡ง๐Ÿ‡ซ๐Ÿ‡ฑ๐Ÿ‡พ๐Ÿ‡ฒ๐Ÿ‡พ๐Ÿ‡ฐ๐Ÿ‡ฎ๐Ÿ‡ฐ๐Ÿ‡ฌ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ฌ๐Ÿ‡ฌ๐Ÿ‡ต๐Ÿ‡ช๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ฒ๐Ÿ‡ผ๐Ÿ‡พ๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ฆ๐Ÿ‡ท๐Ÿ‡ฌ๐Ÿ‡ถ๐Ÿ‡ฌ๐Ÿ‡ท๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ฌ๐Ÿ‡ท๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ธ๐Ÿ‡ณ๐Ÿ‡ฎ๐Ÿ‡ฒ๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡พ๐Ÿ‡ง๐Ÿ‡ท๐Ÿ‡ฏ๐Ÿ‡ช๐Ÿ‡น๐Ÿ‡ณ๐Ÿ‡ต๐Ÿ‡พ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ฌ๐Ÿ‡ฌ๐Ÿ‡ต๐Ÿ‡ช๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฒ๐Ÿ‡ผ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฒ๐Ÿ‡ผ๐Ÿ‡ฑ๐Ÿ‡พ๐Ÿ‡ฒ๐Ÿ‡พ๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡พ๐Ÿ‡จ๐Ÿ‡ฟ๐Ÿ‡ธ๐Ÿ‡ฐ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ป๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ‡ณ๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‡ฎ๐Ÿ‡ฒ๐Ÿ‡ฌ๐Ÿ‡ท๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ฎ๐Ÿ‡ถ๐Ÿ‡ฌ๐Ÿ‡ญ๐Ÿ‡ง๐Ÿ‡ผ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡ฌ๐Ÿ‡ง๐Ÿ‡ฒ๐Ÿ‡ป๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฒ๐Ÿ‡ผ๐Ÿ‡ธ๐Ÿ‡ป๐Ÿ‡ฉ๐Ÿ‡ฏ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ฒ๐Ÿ‡ผ๐Ÿ‡พ๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ป๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ‡ณ๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‡ฎ๐Ÿ‡ฒ๐Ÿ‡ฌ๐Ÿ‡ท๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ท๐Ÿ‡ฌ๐Ÿ‡ฉ๐Ÿ‡ฌ๐Ÿ‡ฌ๐Ÿ‡ต๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡ท๐Ÿ‡ฌ๐Ÿ‡ฉ๐Ÿ‡ฆ๐Ÿ‡ท๐Ÿ‡ฌ๐Ÿ‡ถ๐Ÿ‡ฐ๐Ÿ‡ฎ๐Ÿ‡ฐ๐Ÿ‡ฌ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ท๐Ÿ‡ฏ๐Ÿ‡ช๐Ÿ‡ง๐Ÿ‡ผ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡ง๐Ÿ‡ผ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡ฐ๐Ÿ‡ฟ๐Ÿ‡ง๐Ÿ‡ฟ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฒ๐Ÿ‡ผ๐Ÿ‡ฌ๐Ÿ‡ท๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‡ฎ๐Ÿ‡ฒ๐Ÿ‡ง๐Ÿ‡ผ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฒ๐Ÿ‡ผ๐Ÿ‡ฑ๐Ÿ‡พ๐Ÿ‡ฒ๐Ÿ‡พ๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡พ๐Ÿ‡ง๐Ÿ‡ท๐Ÿ‡ฏ๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ‡ณ๐Ÿ‡ฎ๐Ÿ‡ฒ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡ฐ๐Ÿ‡ฎ๐Ÿ‡ฐ๐Ÿ‡ฌ๐Ÿ‡ธ๐Ÿ‡ฎ๐Ÿ‡ธ๐Ÿ‡ง๐Ÿ‡ป๐Ÿ‡ช๐Ÿ‡ธ๐Ÿ‡ณ๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‡ฎ๐Ÿ‡ฒ๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡พ๐Ÿ‡ฌ๐Ÿ‡ท๐Ÿ‡ง๐Ÿ‡ง๐Ÿ‡ซ๐Ÿ‡ท๐Ÿ‡ฎ๐Ÿ‡ฒ๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡พ๐Ÿ‡ฉ๐Ÿ‡ฟ๐Ÿ‡ฒ๐Ÿ‡ผ๐Ÿ‡ฆ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡พ๐Ÿ‡ง๐Ÿ‡ผ๐Ÿ‡ฒ๐Ÿ‡จ๐Ÿ‡จ๐Ÿ‡ฟ๐Ÿ‡ธ๐Ÿ‡ฐ๐Ÿ‡ธ๐Ÿ‡ท๐Ÿ‡ต๐Ÿ‡ฐ

IMPORTANT : Note that currently only 8-bit encoding is supported, which is sufficient to cover ASCII, but not much more!

Getting started:

The project uses composer to generate a PSR-4 autoloader, so to get started simply

composer install

There a single dependency on php-cli-tools.

Usage:

As indicated there are two types of encoding:

1. Using a pseudo-shebang

  • this integrates the seed into the encoded text, meaning it can be decoded without knowing the seed.
  • the pseudo-shebang indicates both the encoding range (set) and the seed used, a zero-width no-break space (U+FEFF) is used to delimit the pseudo-shebang.
  • hence this technique cannot be used for obfuscation, and is essentially just for amusement!
  • example:
$unicodez = new \Unicodez\ShebangUnicodez();
$encoded = $unicodez->encode("This is some text", \Unicodez\Mappings::TEXT_RUNIC, 123);
$decoded = $unicodez->decode($encoded)

2. Using an explicit seed

  • this means the seed must be known to decode the encoded text.
  • hence this technique can be used for basic obfuscation.
  • example:
$unicodez = new \Unicodez\SeedUnicodez();
$encoded = $unicodez->encode("This is some text", \Unicodez\Mappings::TEXT_RUNIC, 123);
$decoded = $unicodez->decode($encoded, 123)

Tools/Examples

You can mount /public on a local webserver, or use the PHP webserver:

cd public
php -S localhost:8000

and look at:

Include/Autoloader

Since this is implemented in PHP an include method and autoloader are also provided:

These both attempt to decode and evil eval the content.

Here is an example of using the shebang autoloader:

This attempts to add a reasonably sensible autoloader at the start of the PHP autoloader chain (using the prepend attribute), the hope is that you may be able to annoy/confound your colleagues/enemies by providing php implementations like the Runic autoload test script.

Obviously without a suitable plugin your IDE will be unable to assist with auto-completion etc...

Here is how to use the shebang include method:

$unicodez = new \Unicodez\ShebangUnicodez();
$unicodez->include("/src/Runic/SeedRunicTest");

Here is an example using the seeded autoloader.

Here is how to use the seed include method:

$unicodez = new \Unicodez\SeedUnicodez();
$unicodez->include("/src/Runic/SeedRunicTest", 1);

Note that in this case you must provide a seed for decoding, the mapping is determined automatically, but the seed can be kept secret in order to provide trivial obfuscation.

Command Line Tool

There is a command line tool which can be used to bulk encode/decode files.

Example of shebang encoding all files in a directory into Runic with prompts and backups:

./unicodez encode --target ~/Temp --flavour shebang --map Runic --seed 123 --write --verbose

Example of silently decoding all encoded files in a directory:

./uncodez decode --target ~/Temp --silent

The following commands are available:

  • help
  • version
  • status
  • encode
  • decode
  • cache-clear

PSR-12

The code largely conforms to the PSR-12 standard.
This is the tool that is used to check : https://github.com/PHPCSStandards/PHP_CodeSniffer/
Once installed and available globally (presumably via PATH settings), something like this can be used from the root dir:

phpcs --standard=PSR12 ./src/Unicodez/