phantomscript
Version:
convert strings to zero-width unicode or vice-versa
16 lines (14 loc) • 376 B
JavaScript
import {pipe} from 'f-utility'
import {convertToAscii, characterEdge, mapWrap, ninthBit} from '@fn/index'
/**
* convert a string into a zero-width representation
* @method encode
* @param {string} payload - a payload to encode
* @returns {string} encoded string
* @public
*/
export const encode = pipe(
convertToAscii,
mapWrap(ninthBit),
mapWrap(characterEdge)
)