将任何IP地址编码为俳句
pyhipku的Python项目详细描述
一个很小的python库来编码ipv6和ipv4,地址是俳句。这个A hipku(javascript)的python端口。
安装
$ pip install pyhipku
用法
将IP地址编码为俳句
>>> from pyhipku import encode >>> print(encode('127.0.0.1')) The hungry white ape aches in the ancient canyon. Autumn colors crunch.
将俳句解码为IP地址
>>> from pyhipku import decode >>> decode('The hungry white ape\naches in the ancient canyon.\nAutumn colors crunch.\n') '127.0.0.1'
运行测试
$ pip install nose coveralls $ nosetests -v --with-coverage --cover-package=pyhipku
关于网站
演示的源代码是here。
许可证
麻省理工学院