yichin

yichin encode/decode


Keywords
yichin
License
MIT
Install
pip install yichin==1.2

Documentation

yichin

$ pip3 install yichin

This algorithm use Zero-width space to hide the message into string "yichin".

https://pypi.org/project/yichin/

version: 1.2

Example Usage

  • Use ipython notebook
import yichin

# input string and return encoded string
print(yichin.encode("Jellyfish"))
>> 'yic⁤⁦⁥⁦⁦⁧⁩⁦⁦⁦⁩⁧⁣⁦⁨hin'

# input string and return encoded string
print(yichin.decode("yic⁤⁦⁥⁦⁦⁧⁩⁦⁦⁦⁩⁧⁣⁦⁨hin"))
>> 'Jellyfish'

# input string with limited time to decode
print(yichin.encode("Jellyfish", days=1, hours=2, minutes=3, seconds=4))
>> '‭yic⁤⁦⁥⁦⁦⁧⁩⁦⁦⁦⁩⁧⁣⁦⁨‭⁣⁢⁣⁠⁣⁡⁣⁨⁣⁠⁣⁧⁣⁠⁣⁧⁣⁡⁣⁢⁣⁥⁣⁧⁣⁤⁣⁢⁢⁣⁠⁣⁠⁣⁠⁣⁠hin‭'

# If you're in time to decode message
print(yichin.decode("‭yic⁤⁦⁥⁦⁦⁧⁩⁦⁦⁦⁩⁧⁣⁦⁨‭⁣⁢⁣⁠⁣⁡⁣⁨⁣⁠⁣⁧⁣⁠⁣⁧⁣⁡⁣⁢⁣⁥⁣⁧⁣⁤⁣⁢⁢⁣⁠⁣⁠⁣⁠⁣⁠hin‭"))
>> 'Jellyfish'

# input string with limited time to decode
print(yichin.encode("Jellyfish", seconds=1))
>> '‭‭yic⁤⁦⁥⁦⁦⁧⁩⁦⁦⁦⁩⁧⁣⁦⁨‭⁣⁢⁣⁠⁣⁡⁣⁨⁣⁠⁣⁧⁣⁠⁣⁦⁣⁡⁣⁡⁣⁠⁣⁥⁣⁡⁣⁤⁢⁣⁠⁣⁠⁣⁠⁣⁠hin‭'

print(yichin.decode('‭yic⁤⁦⁥⁦⁦⁧⁩⁦⁦⁦⁩⁧⁣⁦⁨‭⁣⁢⁣⁠⁣⁡⁣⁨⁣⁠⁣⁧⁣⁠⁣⁦⁣⁡⁣⁡⁣⁠⁣⁥⁣⁡⁣⁤⁢⁣⁠⁣⁠⁣⁠⁣⁠hin‭'))
>> YichinException: You're out of time to see this message.

pypi tutorial

$ nano ~/.pypirc

[distutils]
index-servers =
  pypi
  pypitest

[pypi]
repository: https://upload.pypi.org/legacy/
username: <your_username>
password: <your_password>

[pypitest]
repository: https://test.pypi.org/legacy/
username: <your_username>
password: <your_password>

$ nano setup.py

from distutils.core import setup

setup(
  name = <package_name>,
  packages = [<package_name>], # this must be the same as the name above
  version = '0.1',
  description = <description>,
  author = <author>,
  author_email = <author_email>',
  url = <your_github_repo_link>,
  keywords = [<keyword>, <keyword>, <keyword>], # arbitrary keywords
  classifiers = [],
)

$ python3 setup.py check

$ python3 setup.py sdist

$ python3 setup.py sdist register upload -r pypitest

$ python3 setup.py sdist register upload -r pypi