ZeroWidthEncoder

Zero-width steganographic text encoding (Oversec-compatible mapping).

Embeds a length-prefixed UTF-8 payload in Unicode zero-width and variation-selector code points, prefixed with a PSH magic header. Uses spread markers to reduce detection of long invisible runs.

Functions

Link copied to clipboard
fun decode(text: String): String?

Decodes a zero-width payload from text, or null if magic, length, or mapping is invalid.

Link copied to clipboard
fun encode(plaintext: String, visiblePrefix: String = "", spread: Int = SPREAD): String

Encodes plaintext as invisible characters, optionally prefixed with visible decoy text.

Link copied to clipboard

Removes leading zero-width encoded bytes from s, returning the first visible suffix.