npm.io
1.0.4 • Published 8 years ago

unseen-data

Licence
MIT
Version
1.0.4
Deps
4
Size
5 kB
Vulns
0
Weekly
0
Stars
8

unseen-data

Convert data to an unseen zero-width binary string.

Example

import Unseen from 'unseen-data'
const unseen = new Unseen({ compression: true })

const encoded = unseen.encode('Hello world!')
// encoded = '​​​​‍​‍‌​‍​‌‍‌‌‌‍​‌‍​‌‍​‍​​‌‌‌‍‌​‍‌‍​‌‍‌​​‍​‌​‍​‍'

const decoded = unseen.decode(encoded)
// decoded = 'Hello world!'

Options

Options can be passed as an object in the constructor.

compression?: boolean

By default, data is compressed with pako to reduce the length of the resulting strings.

charset?: [string, string, string, string]

By default, unseen-data uses a Base4 charset consisting of four different types of invisible characters.