| Crates.io | zw |
| lib.rs | zw |
| version | 0.2.0 |
| created_at | 2021-07-17 17:04:31.069427+00 |
| updated_at | 2022-08-13 22:34:25.418629+00 |
| description | Utility for encoding and decoding text using zero-width characters |
| homepage | |
| repository | https://github.com/tje/rs-zw |
| max_upload_size | |
| id | 424095 |
| size | 12,172 |
Utility for encoding and decoding text using zero-width characters.
Subject text is first converted to its binary representation (e.g. "foo" -> "011001100110111101101111"), then each digit is replaced with a zero-width character (specifically: U+200B and U+200C). Decoding is simply the inverse of the same flow of operations.
As a module:
use zw;
// ...
let encoded = zw::encode("Hello");
let decoded = zw::decode(&encoded);
As a CLI tool:
zw [-e|--encode] [-d|--decode] [input]
If both -e and -d flags are omitted then conversion direction is guessed based on the first interpreted character.
Reads from stdin if an input string isn't provided in its arguments.
# Shell-ish
zw "Hello" > encoded.txt
cat encoded.txt | zw > decoded.txt
# MacOS clipboard encoding
pbpaste | zw | pbcopy