Giter VIP home page Giter VIP logo

z.js's Introduction

z.js—turns content (in)visible*

*using Unicode's ZW(N)Js (\u200c, \u200d)

Demos

http://kptl.co/z.js/blog-demo.php
http://kptl.co/z.js/website.php
http://kptl.co/z.js/mailto-links.php

Changelog/Usage

/*

CHANGELOG
0.2 (July 2013)
* dropped 'ASCII-mode' (tabs (\t) and spaces (\x20) instead of Unicode's ZW(N)Js)
* added 'Parts-mode'; 2nd char in MASK param
* header changed; old: "<!---->", new: \x00\x00\x00\x00\xff\xff\xff\xff



z.js(DAT [, PWD=false, MSK/RAW=false])

DAT -- content to hide/restore
       (z.js only parses \u200c and \u200d)
PWD -- Password (RC4)
MSK -- MASK; default (TRUE): ▉
       (optional 2nd char: Parts-mode (see Example 2.1))
RAW -- if TRUE, returns raw data instead of FALSE if encrypted


*/


1.   //Basic example; results in zero-width (168=("8"*8)+("11"*8)+"16")
     var tmp='Something'+z.js('hello world')+' inside';
     console.log(tmp,tmp.length); → Something‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‍‍‌‍‌‌‌‌‍‍‌‌‍‌‍‌‍‍‌‍‍‌‌‌‍‍‌‍‍‌‌‌‍‍‌‍‍‍‍‌‌‍‌‌‌‌‌‌‍‍‍‌‍‍‍‌‍‍‌‍‍‍‍‌‍‍‍‌‌‍‌‌‍‍‌‍‍‌‌‌‍‍‌‌‍‌‌ inside 168
     console.log(z.js(tmp)); → hello world


2.   //Masking; tags excluded
     console.log(z.js('hello <em>world</em>',false,'*')) → *‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‍‍‌‍‌‌‌‌‍‍‌‌‍‌‍‌‍‍‌‍‍‌‌‌‍‍‌‍‍‌‌‌‍‍‌‍‍‍‍‌‌‍‌‌‌‌‌‌‌‍‍‍‍‌‌‌‍‍‌‌‍‌‍‌‍‍‌‍‍‌‍‌‌‍‍‍‍‍‌‌‍‍‍‌‍‍‍‌‍‍‌‍‍‍‍‌‍‍‍‌‌‍‌‌‍‍‌‍‍‌‌‌‍‍‌‌‍‌‌‌‌‍‍‍‍‌‌‌‌‍‌‍‍‍‍‌‍‍‌‌‍‌‍‌‍‍‌‍‍‌‍‌‌‍‍‍‍‍‌**** *****


2.1  //'Parts'-mode (2nd MSK-char); keeps wrapped content
     var tmp=z.js('hides only *this* and *that*.',false,'**');
     console.log(tmp) → hides only ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌*‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‍‍‍‌‍‌‌‌‍‍‌‍‌‌‌‌‍‍‌‍‌‌‍‌‍‍‍‌‌‍‍*** and ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌*‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‍‍‍‌‍‌‌‌‍‍‌‍‌‌‌‌‍‍‌‌‌‌‍‌‍‍‍‌‍‌‌***.
     console.log(z.js(tmp)) → hides only this and that.
     console.log(z.js('Re*pla*ce aster*iks-wrapped* with DOTS',false,'.*'));
     → Re‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌.‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‍‍‍‌‌‌‌‌‍‍‌‍‍‌‌‌‍‍‌‌‌‌‍..ce aster‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌.‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‌‍‍‌‍‌‌‍‌‍‍‌‍‌‍‍‌‍‍‍‌‌‍‍‌‌‍‌‍‍‌‍‌‍‍‍‌‍‍‍‌‍‍‍‌‌‍‌‌‍‍‌‌‌‌‍‌‍‍‍‌‌‌‌‌‍‍‍‌‌‌‌‌‍‍‌‌‍‌‍‌‍‍‌‌‍‌‌.......... with DOTS
     console.log(z.js('@hello wo@rld@',false,'@@')); → false "(?)"



3.  //Encrypt
    console.log(z.js(z.js('hello world','yay'),'nay')); → false
    console.log(z.js(z.js('hello world','yay'),'yay')) → hello world
    console.log(z.js(z.js('hello world','yay'),'nay',true)) → }�Ý©Ò�Eû@�ó[î(L�    �¥

z.js's People

Watchers

斯人 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.