Tinxy Package
Project description
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tinxy-0.2.6.tar.gz
(7.8 kB
view details)
Built Distribution
tinxy-0.2.6-py3-none-any.whl
(6.7 kB
view details)
File details
Details for the file tinxy-0.2.6.tar.gz
.
File metadata
- Download URL: tinxy-0.2.6.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b964dd3ca29e7a383701fc89c70d3279b9967f89716165365b69faca3891d3aa |
|
MD5 | 9367f502568a93728499595c4c349f16 |
|
BLAKE2b-256 | 5d4c7a1a6d5f515dec438aaaf090f7b1f6c474808ad05ac361574ba989c9712f |
File details
Details for the file tinxy-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: tinxy-0.2.6-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5c56caa2ce77042a12f59d39e4c70f5ef9f708b07eda566269d101b25f0aea8 |
|
MD5 | 5bb5baed68ed9853a966f58b7150e0bb |
|
BLAKE2b-256 | a6a365ee5197c08373ee9d1adc5307b93d5e604185d09fc3c211887c18bf7182 |