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.5.tar.gz
(7.8 kB
view details)
Built Distribution
tinxy-0.2.5-py3-none-any.whl
(6.7 kB
view details)
File details
Details for the file tinxy-0.2.5.tar.gz
.
File metadata
- Download URL: tinxy-0.2.5.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 | 2d3932b1f7aec8a0244a56f0e71dd3ef54243843ddbc87f1b493d30ea6c719ac |
|
MD5 | 539a2b166409abd3caa57e3c7fc34497 |
|
BLAKE2b-256 | 3e2ee55e1601e9266772d98ef098b45ab4c35bd0df47bdd9f33085f0a37ef7cd |
File details
Details for the file tinxy-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: tinxy-0.2.5-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 | 2ec3aa532e30218501b8ef15e23f8bc4e0361c8189601a7666f90ebab9be872f |
|
MD5 | 9d65829e2e09dcc96fcd0127e7cd9ad4 |
|
BLAKE2b-256 | 2afed7c95d07db9f6a8dee2aed249f2d0a73a7d1fb108a34b2d2bc90bc5d956c |