DIZZER
Bidirectional human-readable weird-text encoder/decoder.
For each original word in the original text, it leaves the first and last character of it in that position, but shuffles (permutates) all the characters in the middle of the word. If possible, the resulting “encoded” word is different than the original word.
Words shorter than 4 characters or with double letters inside - like: "keep", "seen", "moon" cannot be scrambled - because swapping its characters has no effect.
Key features:
- simple, straight-forward
- 100% translatable - back and fourth
- codec is lossless and doesn't need any additional data for translation
- scrambles all numbers and slugs as well
- keeps other non-word text parts unchanged
Scrambling order is pseudo-random and different for each word.
Usage
import dizzer
original_text = """
Text can contain unlimited number of whitespaces, newlines etc.
Numbers like 12345, 1234567, 987654321 or 123456789 are also scrambled.
"""
encoded = dizzer.encode(original_text)
print(encoded)
# Txet can cnitaon umnitelid nmeubr of wtsehaecips, newniels etc.
# Numbres lkie 14325, 1346257, 967843251 or 143267859 are aslo scrmeabld.
# reverse operation:
decoded = dizzer.decode(encoded)
print(decoded)
# Text can contain unlimited number of whitespaces, newlines etc.
# Numbers like 12345, 1234567, 987654321 or 123456789 are also scrambled.
Installation
pip install dizzer
It has no dependencies and works in python 3.7, 3.8, 3.9 and pypy3.
Interoperability check
There is non-zero probability, that the algorithm works different on sophisticated environments (i.e. when your python interpreter uses weird pseudo-random generator library).
At import time of dizzer package there is a self-check statement.
It checks if this algorithm works in your environment.
There is a snippet that raises an import error if a malfunction is detected.
In other words - if you are able to import dizzer - you can be sure, that your
encoded text can be decoded on othr machines.
The self-check statement
import dizzer
PROPER_TEXT = """
This sentence approves that dizzer can be used on your machine.
If this assertion is not raised - it means you can read and write messages
that are fully translatable on other machines.
"""
EXPECTED_ENCODING = """
Tihs senectne aepvorps taht dzzier can be uesd on yuor mhcaine.
If tihs aosirtsen is not risaed - it mneas you can raed and wtrie msesgeas
taht are fluly tbnslalatrae on oethr mhacneis.
"""
local_encoding = dizzer.encode(PROPER_TEXT)
back = dizzer.decode(local_encoding)
assert local_encoding == EXPECTED_ENCODING, "Failed to encode."
assert back == PROPER_TEXT, "Failed to decode."
Metadata
Release files for dizzer 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dizzer-0.1.2.tar.gz | 6.4 kB | Without provenance | Details for dizzer-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dizzer-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for dizzer-0.1.2-py3-none-any.whl |
Total release size: 12.9 kB
Release files / dizzer-0.1.2.tar.gz
| Download URL | dizzer-0.1.2.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d2d6d48793b237df08b8e36f3639304669e492567ffb08be91947a4f63f7c24
|
|
BLAKE2b-256 checksum How to use checksums |
a53086153e498e74090b7ce19e67d2c79c990cbd22428a9ac45e0e88496c797b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Release files / dizzer-0.1.2-py3-none-any.whl
| Download URL | dizzer-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1927b950f5ad17adcb35d4e46fced1ada37d4c7bcf40ad7c5ca5b609c973afba
|
|
BLAKE2b-256 checksum How to use checksums |
64daf358ef649b480b53af1ac01272aed84ba326584c16136c7d12bf8519daa4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Security for dizzer 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.