mirror of
https://github.com/inzerosight/ZWUS.git
synced 2026-09-18 10:55:44 +00:00
51 lines
1.2 KiB
Markdown
51 lines
1.2 KiB
Markdown
# Zero Width Unicode Standard (ZWUS)
|
|
|
|
Zero Width Unicode Steganography — hide text inside invisible characters.
|
|
|
|
`npm install zwus`
|
|
|
|
## Usage
|
|
|
|
```js
|
|
import zwus from 'zwus';
|
|
|
|
// Encode & decode strings
|
|
const hidden = zwus.encodeString("secret");
|
|
const revealed = zwus.decodeToString(hidden);
|
|
// "secret"
|
|
|
|
// Encode & decode number arrays
|
|
const encoded = zwus.encodeNumberArray([72, 101, 108]);
|
|
const decoded = zwus.decodeToNumberArray(encoded);
|
|
// [72, 101, 108]
|
|
```
|
|
|
|
### Base
|
|
|
|
Higher base = shorter output, but more likely visible in some renderers.
|
|
|
|
```js
|
|
zwus.encodeString("hi", 3) // safest
|
|
zwus.encodeString("hi", 6) // default, compact
|
|
zwus.encodeString("hi", 8) // most compact
|
|
```
|
|
|
|
Decode must match the encode base:
|
|
|
|
```js
|
|
zwus.decodeToString(encoded, 6)
|
|
```
|
|
|
|
## Interop
|
|
|
|
Encoded output is byte-identical to the [Rust crate](https://crates.io/crates/zwus), so you can encode in JS and decode in Rust or vice versa.
|
|
|
|
## License
|
|
|
|
[WTFPL](license)
|
|
|
|
## Browser Extension
|
|
|
|
You can also use ZWUS in your browser with [inØsight](https://github.com/inzerosight/inzerosight): [Firefox Add-on](https://addons.mozilla.org/en-US/firefox/addon/in0sight/) · [Chrome Web Store](https://chromewebstore.google.com/detail/acnmohbphjmnbaboacmecidopeplkhog)
|
|
|