ltotp 1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ltotp-1.0/PKG-INFO ADDED
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: ltotp
3
+ Version: 1.0
4
+ Requires-Dist: lhfsp
5
+ Dynamic: requires-dist
@@ -0,0 +1 @@
1
+ from .main import ltotp
@@ -0,0 +1,22 @@
1
+ # ltotp
2
+ from time import time
3
+ import lhfsp
4
+
5
+ def timetokey(Time, window):
6
+ timestep = int(Time) // window
7
+ sstep = str(timestep).zfill(8)
8
+ lastfour = sstep[-8:]
9
+ key = ''
10
+ for digit in lastfour:
11
+ key += chr(int(digit) + 65)
12
+ key1 = key[:4]
13
+ key2 = key[4:]
14
+
15
+ return key1, key2
16
+
17
+ def ltotp(secret, window=60):
18
+ Time = time()
19
+ key1, key2 = timetokey(Time, window)
20
+ hashed = lhfsp.keyhash(secret, key1, key2)
21
+ code = ''.join([str(ord(c)) for c in hashed[:6]])
22
+ return code[:6].zfill(6)
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: ltotp
3
+ Version: 1.0
4
+ Requires-Dist: lhfsp
5
+ Dynamic: requires-dist
@@ -0,0 +1,8 @@
1
+ setup.py
2
+ ltotp/__init__.py
3
+ ltotp/main.py
4
+ ltotp.egg-info/PKG-INFO
5
+ ltotp.egg-info/SOURCES.txt
6
+ ltotp.egg-info/dependency_links.txt
7
+ ltotp.egg-info/requires.txt
8
+ ltotp.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ lhfsp
@@ -0,0 +1 @@
1
+ ltotp
ltotp-1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
ltotp-1.0/setup.py ADDED
@@ -0,0 +1,8 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name='ltotp',
5
+ version='1.0',
6
+ packages=find_packages(),
7
+ install_requires=['lhfsp'],
8
+ )