transcrypto 1.4.0__tar.gz → 1.5.1__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.
Files changed (22) hide show
  1. {transcrypto-1.4.0/src/transcrypto.egg-info → transcrypto-1.5.1}/PKG-INFO +2 -2
  2. {transcrypto-1.4.0 → transcrypto-1.5.1}/README.md +1 -1
  3. {transcrypto-1.4.0 → transcrypto-1.5.1}/pyproject.toml +1 -1
  4. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/base.py +13 -4
  5. {transcrypto-1.4.0 → transcrypto-1.5.1/src/transcrypto.egg-info}/PKG-INFO +2 -2
  6. {transcrypto-1.4.0 → transcrypto-1.5.1}/LICENSE +0 -0
  7. {transcrypto-1.4.0 → transcrypto-1.5.1}/setup.cfg +0 -0
  8. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/__init__.py +0 -0
  9. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/aes.py +0 -0
  10. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/constants.py +0 -0
  11. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/dsa.py +0 -0
  12. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/elgamal.py +0 -0
  13. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/modmath.py +0 -0
  14. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/profiler.py +0 -0
  15. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/py.typed +0 -0
  16. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/rsa.py +0 -0
  17. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/safetrans.py +0 -0
  18. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/sss.py +0 -0
  19. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto/transcrypto.py +0 -0
  20. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto.egg-info/SOURCES.txt +0 -0
  21. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto.egg-info/dependency_links.txt +0 -0
  22. {transcrypto-1.4.0 → transcrypto-1.5.1}/src/transcrypto.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: transcrypto
3
- Version: 1.4.0
3
+ Version: 1.5.1
4
4
  Summary: Basic crypto primitives, not intended for actual use, but as a companion to --Criptografia, Métodos e Algoritmos--
5
5
  Author-email: Daniel Balparda <balparda@github.com>
6
6
  License-Expression: Apache-2.0
@@ -984,7 +984,7 @@ deactivate
984
984
 
985
985
  ### Updating Dependencies
986
986
 
987
- To update `poetry.lock` file to more current versions do `poetry update`, it will ignore the current lock, update, and rewrite the `poetry.lock` file.
987
+ To update `poetry.lock` file to more current versions do `poetry update`, it will ignore the current lock, update, and rewrite the `poetry.lock` file. If you have cache problems `poetry cache clear PyPI --all` will clean it.
988
988
 
989
989
  To add a new dependency you should do:
990
990
 
@@ -966,7 +966,7 @@ deactivate
966
966
 
967
967
  ### Updating Dependencies
968
968
 
969
- To update `poetry.lock` file to more current versions do `poetry update`, it will ignore the current lock, update, and rewrite the `poetry.lock` file.
969
+ To update `poetry.lock` file to more current versions do `poetry update`, it will ignore the current lock, update, and rewrite the `poetry.lock` file. If you have cache problems `poetry cache clear PyPI --all` will clean it.
970
970
 
971
971
  To add a new dependency you should do:
972
972
 
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
8
8
 
9
9
  [project]
10
10
  name = "transcrypto"
11
- version = "1.4.0"
11
+ version = "1.5.1"
12
12
  description = "Basic crypto primitives, not intended for actual use, but as a companion to --Criptografia, Métodos e Algoritmos--"
13
13
  readme = "README.md"
14
14
  license = "Apache-2.0"
@@ -11,7 +11,7 @@ import argparse
11
11
  import base64
12
12
  import codecs
13
13
  import dataclasses
14
- # import datetime
14
+ import datetime
15
15
  import enum
16
16
  import functools
17
17
  import hashlib
@@ -32,11 +32,10 @@ from scipy import stats # type:ignore
32
32
  import zstandard
33
33
 
34
34
  __author__ = 'balparda@github.com'
35
- __version__ = '1.4.0' # 2026-01-13, Tue
35
+ __version__ = '1.5.1' # 2026-01-13, Tue
36
36
  __version_tuple__: tuple[int, ...] = tuple(int(v) for v in __version__.split('.'))
37
37
 
38
- # MIN_TM = int( # minimum allowed timestamp
39
- # datetime.datetime(2000, 1, 1, 0, 0, 0).replace(tzinfo=datetime.timezone.utc).timestamp())
38
+ # Data conversion utils
40
39
 
41
40
  BytesToHex: Callable[[bytes], str] = lambda b: b.hex()
42
41
  BytesToInt: Callable[[bytes], int] = lambda b: int.from_bytes(b, 'big', signed=False)
@@ -50,6 +49,16 @@ EncodedToBytes: Callable[[str], bytes] = lambda e: base64.urlsafe_b64decode(e.en
50
49
 
51
50
  PadBytesTo: Callable[[bytes, int], bytes] = lambda b, i: b.rjust((i + 7) // 8, b'\x00')
52
51
 
52
+ # Time utils
53
+
54
+ MIN_TM = int(
55
+ datetime.datetime(2000, 1, 1, 0, 0, 0).replace(tzinfo=datetime.timezone.utc).timestamp())
56
+ TIME_FORMAT = '%Y/%b/%d-%H:%M:%S-UTC'
57
+ TimeStr: Callable[[int | float | None], str] = lambda tm: (
58
+ time.strftime(TIME_FORMAT, time.gmtime(tm)) if tm else '-')
59
+ Now: Callable[[], int] = lambda: int(time.time())
60
+ StrNow: Callable[[], str] = lambda: TimeStr(Now())
61
+
53
62
  # SI prefix table, powers of 1000
54
63
  _SI_PREFIXES: dict[int, str] = {
55
64
  -6: 'a', # atto
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: transcrypto
3
- Version: 1.4.0
3
+ Version: 1.5.1
4
4
  Summary: Basic crypto primitives, not intended for actual use, but as a companion to --Criptografia, Métodos e Algoritmos--
5
5
  Author-email: Daniel Balparda <balparda@github.com>
6
6
  License-Expression: Apache-2.0
@@ -984,7 +984,7 @@ deactivate
984
984
 
985
985
  ### Updating Dependencies
986
986
 
987
- To update `poetry.lock` file to more current versions do `poetry update`, it will ignore the current lock, update, and rewrite the `poetry.lock` file.
987
+ To update `poetry.lock` file to more current versions do `poetry update`, it will ignore the current lock, update, and rewrite the `poetry.lock` file. If you have cache problems `poetry cache clear PyPI --all` will clean it.
988
988
 
989
989
  To add a new dependency you should do:
990
990
 
File without changes
File without changes