# Tinxy Package
Used for authenticating with tinxy.in
# Usage
```
# pip install tinxy
# Python 3
import time
import base64
import requests
from tinxy import tinxy
import time
def encrypts(arg1, mqttpass):
en_arg1 = tinxy.strToLongs(arg1.encode('utf-8').decode())
en_mqttpass = tinxy.strToLongs(mqttpass.encode('utf-8').decode())
ed = tinxy.encodes(en_arg1, en_mqttpass)
ciphertext = tinxy.longsToStr(ed)
cipherutf2 = ciphertext.encode('latin-1')
cipherbase64 = base64.b64encode(cipherutf2)
return base64.b64decode(cipherbase64).hex()
tm = str(int(time.time()))
data = encrypts(tm, "mqtt-password-here")
response = requests.post("http://10.0.28.17/toggle", json={
"password": data,
"action": "1",
"relayNumber": 2
})
print(response)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/arevindh/tinxy",
"name": "tinxy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "Tinxy, tinxy.in",
"author": "Siddhu",
"author_email": "me@siddhu.dev",
"download_url": "https://files.pythonhosted.org/packages/5d/4c/7a1a6d5f515dec438aaaf090f7b1f6c474808ad05ac361574ba989c9712f/tinxy-0.2.6.tar.gz",
"platform": null,
"description": "# Tinxy Package \r\n\r\nUsed for authenticating with tinxy.in\r\n\r\n# Usage\r\n\r\n```\r\n# pip install tinxy\r\n# Python 3\r\n\r\nimport time\r\nimport base64\r\nimport requests\r\nfrom tinxy import tinxy\r\nimport time\r\n\r\ndef encrypts(arg1, mqttpass):\r\n en_arg1 = tinxy.strToLongs(arg1.encode('utf-8').decode())\r\n en_mqttpass = tinxy.strToLongs(mqttpass.encode('utf-8').decode())\r\n ed = tinxy.encodes(en_arg1, en_mqttpass)\r\n ciphertext = tinxy.longsToStr(ed)\r\n cipherutf2 = ciphertext.encode('latin-1')\r\n cipherbase64 = base64.b64encode(cipherutf2)\r\n return base64.b64decode(cipherbase64).hex()\r\n\r\ntm = str(int(time.time()))\r\ndata = encrypts(tm, \"mqtt-password-here\")\r\n\r\nresponse = requests.post(\"http://10.0.28.17/toggle\", json={\r\n \"password\": data,\r\n \"action\": \"1\",\r\n \"relayNumber\": 2\r\n})\r\n\r\nprint(response)\r\n```\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Tinxy Package",
"version": "0.2.6",
"project_urls": {
"Bug Reports": "https://github.com/arevindh/tinxy/issues",
"Documentation": "https://github.com/arevindh/tinxy",
"Homepage": "https://github.com/arevindh/tinxy",
"Source Code": "https://github.com/arevindh/tinxy"
},
"split_keywords": [
"tinxy",
" tinxy.in"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a6a365ee5197c08373ee9d1adc5307b93d5e604185d09fc3c211887c18bf7182",
"md5": "5bb5baed68ed9853a966f58b7150e0bb",
"sha256": "a5c56caa2ce77042a12f59d39e4c70f5ef9f708b07eda566269d101b25f0aea8"
},
"downloads": -1,
"filename": "tinxy-0.2.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5bb5baed68ed9853a966f58b7150e0bb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6739,
"upload_time": "2024-07-06T14:56:18",
"upload_time_iso_8601": "2024-07-06T14:56:18.198480Z",
"url": "https://files.pythonhosted.org/packages/a6/a3/65ee5197c08373ee9d1adc5307b93d5e604185d09fc3c211887c18bf7182/tinxy-0.2.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5d4c7a1a6d5f515dec438aaaf090f7b1f6c474808ad05ac361574ba989c9712f",
"md5": "9367f502568a93728499595c4c349f16",
"sha256": "b964dd3ca29e7a383701fc89c70d3279b9967f89716165365b69faca3891d3aa"
},
"downloads": -1,
"filename": "tinxy-0.2.6.tar.gz",
"has_sig": false,
"md5_digest": "9367f502568a93728499595c4c349f16",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7787,
"upload_time": "2024-07-06T14:56:19",
"upload_time_iso_8601": "2024-07-06T14:56:19.824018Z",
"url": "https://files.pythonhosted.org/packages/5d/4c/7a1a6d5f515dec438aaaf090f7b1f6c474808ad05ac361574ba989c9712f/tinxy-0.2.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-06 14:56:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "arevindh",
"github_project": "tinxy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "tinxy"
}