secretting 1.6.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.
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.4
2
+ Name: secretting
3
+ Version: 1.6.0
4
+ Summary: More secrets and randoms!
5
+ Description-Content-Type: text/markdown
6
+ Dynamic: description
7
+ Dynamic: description-content-type
8
+ Dynamic: summary
9
+
10
+ # Secretting 1.6.0
11
+
12
+ # More secrets and randoms!
13
+ # Installation:
14
+ ```bash
15
+ pip install secreting
16
+ ```
17
+ ## If wont work:
18
+ ```bash
19
+ pip3 install secreting
20
+ ```
21
+ ## Or:
22
+ ```bash
23
+ pip install --upgrade secreting
24
+ ```
25
+
26
+ # Example:
27
+ ```python
28
+ salt() # Output: salt
29
+ sha256("a") # Output: hash
30
+ secure256("a") # Output: (hash, salt)
31
+ isEqual(1, 1) # Output: True
32
+ isEqual(1, 2) # Output: False
33
+ chars # Output: (ascii_letters, digits, punctuation)
34
+ tokenHex(32) # Output: token with 32 bytes
35
+ # And more nice tools!
36
+ ```
37
+ # Libs:
38
+ ## Secrets (choice, compare_digest)
39
+ ## Random (shuffle, random, randint)
40
+ ## String (ascii_letters, digits, punctuation)
41
+ ## Hashlib (sha256, sha512)
42
+
43
+ # Github
44
+ ## [My github account](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
45
+
46
+ # Random scheme
47
+ ## Secretting uses Chaos 20 system
48
+ ## How it works:
49
+ ```python
50
+ import random
51
+
52
+ def x_or_o():
53
+ return random.choice(["x", "o"])
54
+ def chaos20system(func):
55
+ return random.choice([func() for _ in range(20)]) # It can be anything. Example: ["x", "x", "o", "x", "o", "o", ...]
56
+
57
+ print(chaos20system(x_or_o)) # It is more random than classic choice.
58
+ ```
59
+
60
+ # Enjoy it!
61
+
62
+
63
+
64
+ hi
@@ -0,0 +1,127 @@
1
+ """# Secretting 1.4.5
2
+
3
+ # More secrets and randoms!
4
+ # Installation:
5
+ ```bash
6
+ pip install secreting
7
+ ```
8
+ ## If wont work:
9
+ ```bash
10
+ pip3 install secreting
11
+ ```
12
+ ## Or:
13
+ ```bash
14
+ pip install --upgrade secreting
15
+ ```
16
+
17
+ # Example:
18
+ ```python
19
+ salt() # Output: salt
20
+ sha256("a") # Output: hash
21
+ secure256("a") # Output: (hash, salt)
22
+ isEqual(1, 1) # Output: True
23
+ isEqual(1, 2) # Output: False
24
+ chars # Output: (ascii_letters, digits, punctuation)
25
+ tokenHex(32) # Output: token with 32 bytes
26
+ # And more nice tools!
27
+ ```
28
+ # Libs:
29
+ ## Secrets (choice, compare_digest)
30
+ ## Random (shuffle, random, randint)
31
+ ## String (ascii_letters, digits, punctuation)
32
+ ## Hashlib (sha256, sha512)
33
+
34
+ # Github
35
+ ## [My github account](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
36
+
37
+ # Enjoy it!
38
+
39
+
40
+
41
+ hi"""
42
+
43
+ from typing import Any
44
+ from secrets import choice as _choice, compare_digest
45
+ from secrets import token_hex as _tkhex
46
+ import random as _rand
47
+ from random import random as _random
48
+ from string import ascii_letters as letters, digits, punctuation
49
+ from hashlib import sha512 as s512, sha256 as s256
50
+ from getpass import getpass
51
+
52
+ chars: tuple = (*letters, *digits, *punctuation)
53
+ def salt(length: int = 9) -> str:
54
+ return ''.join(_choice(chars) for _ in range(length))
55
+ def sha256(text: str) -> str:
56
+ return s256(text.encode()).hexdigest()
57
+ def sha512(text: str) -> str:
58
+ return s512(text.encode()).hexdigest()
59
+ def secure256(text: str, customSalt: str = None) -> tuple:
60
+ gSalt: str = customSalt or salt()
61
+ return sha256(text + gSalt), gSalt
62
+ def secure512(text: str, customSalt: str = None) -> tuple:
63
+ gSalt: str = customSalt or salt()
64
+ return sha512(text + gSalt), gSalt
65
+ def multi256(text: str, times: int = 3) -> str:
66
+ return sha256(text * times)
67
+ def multi512(text: str, times: int = 3) -> str:
68
+ return sha512(text * times)
69
+ def hashByKey(text: str, key: str, delim: str = '') -> str:
70
+ result = []
71
+ for i, c in enumerate(text):
72
+ result.append(str(ord(c) ^ ord(key[i % len(key)])))
73
+ return delim.join(result)
74
+ def randint(min: int, max: int) -> int:
75
+ return _choice([_rand.randint(min, max) for _ in range(20)])
76
+ def choice(seq: list) -> Any:
77
+ return _choice([_choice(seq) for _ in range(20)])
78
+ def random() -> float:
79
+ return _choice([_random() for _ in range(20)])
80
+ def tokenHex(nbytes) -> str:
81
+ return _choice([_tkhex(nbytes) for _ in range(20)])
82
+ def safeFunc(func, *args, **kwargs) -> Any:
83
+ return _choice([func(*args, **kwargs) for _ in range(20)])
84
+ def shuffle(seq: list) -> list:
85
+ def _temp():
86
+ temp = list(seq)
87
+ _rand.shuffle(temp)
88
+ return temp
89
+ return _choice([_temp() for _ in range(20)])
90
+ def password(length: int = 12) -> str:
91
+ def raw():
92
+ return ''.join([_choice(chars) for _ in range(length)])
93
+ return _choice([raw() for _ in range(20)])
94
+ def roll(chance: int = 50) -> bool:
95
+ def raw():
96
+ return _rand.randint(1, 100) <= chance
97
+ return _choice([raw() for _ in range(20)])
98
+ def isEqual(a, b) -> bool:
99
+ return compare_digest(a, b)
100
+ def loadEnv() -> dict:
101
+ res = {}
102
+ try:
103
+ with open('.env', 'r') as f:
104
+ datas = f.read()
105
+ if datas:
106
+ lines = datas.split('\n')
107
+ for line in lines:
108
+ args = line.split('=')
109
+ res[args[0]] = args[1]
110
+ except FileNotFoundError:
111
+ pass
112
+ return res
113
+ def hiddenInput(prompt: str) -> str:
114
+ return getpass(prompt)
115
+ def tokenNum(length: int = 16):
116
+ def raw():
117
+ cdigits = '1234567890'
118
+ return ''.join(_choice(cdigits) for _ in range(length))
119
+ return _choice([raw() for _ in range(20)])
120
+ def customToken(length: int = 16, symbols = 'kanderus'):
121
+ def raw():
122
+ return ''.join(_choice(symbols) for _ in range(length))
123
+ return _choice([raw() for _ in range(20)])
124
+
125
+
126
+ # you reached the end of secreting lib
127
+ # congrats
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.4
2
+ Name: secretting
3
+ Version: 1.6.0
4
+ Summary: More secrets and randoms!
5
+ Description-Content-Type: text/markdown
6
+ Dynamic: description
7
+ Dynamic: description-content-type
8
+ Dynamic: summary
9
+
10
+ # Secretting 1.6.0
11
+
12
+ # More secrets and randoms!
13
+ # Installation:
14
+ ```bash
15
+ pip install secreting
16
+ ```
17
+ ## If wont work:
18
+ ```bash
19
+ pip3 install secreting
20
+ ```
21
+ ## Or:
22
+ ```bash
23
+ pip install --upgrade secreting
24
+ ```
25
+
26
+ # Example:
27
+ ```python
28
+ salt() # Output: salt
29
+ sha256("a") # Output: hash
30
+ secure256("a") # Output: (hash, salt)
31
+ isEqual(1, 1) # Output: True
32
+ isEqual(1, 2) # Output: False
33
+ chars # Output: (ascii_letters, digits, punctuation)
34
+ tokenHex(32) # Output: token with 32 bytes
35
+ # And more nice tools!
36
+ ```
37
+ # Libs:
38
+ ## Secrets (choice, compare_digest)
39
+ ## Random (shuffle, random, randint)
40
+ ## String (ascii_letters, digits, punctuation)
41
+ ## Hashlib (sha256, sha512)
42
+
43
+ # Github
44
+ ## [My github account](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
45
+
46
+ # Random scheme
47
+ ## Secretting uses Chaos 20 system
48
+ ## How it works:
49
+ ```python
50
+ import random
51
+
52
+ def x_or_o():
53
+ return random.choice(["x", "o"])
54
+ def chaos20system(func):
55
+ return random.choice([func() for _ in range(20)]) # It can be anything. Example: ["x", "x", "o", "x", "o", "o", ...]
56
+
57
+ print(chaos20system(x_or_o)) # It is more random than classic choice.
58
+ ```
59
+
60
+ # Enjoy it!
61
+
62
+
63
+
64
+ hi
@@ -0,0 +1,6 @@
1
+ setup.py
2
+ secretting/__init__.py
3
+ secretting.egg-info/PKG-INFO
4
+ secretting.egg-info/SOURCES.txt
5
+ secretting.egg-info/dependency_links.txt
6
+ secretting.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ secretting
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,67 @@
1
+ from io import open
2
+ from setuptools import setup, find_packages
3
+
4
+
5
+ setup(
6
+ name='secretting',
7
+ version='1.6.0',
8
+ description='More secrets and randoms!',
9
+ long_description='''# Secretting 1.6.0
10
+
11
+ # More secrets and randoms!
12
+ # Installation:
13
+ ```bash
14
+ pip install secreting
15
+ ```
16
+ ## If wont work:
17
+ ```bash
18
+ pip3 install secreting
19
+ ```
20
+ ## Or:
21
+ ```bash
22
+ pip install --upgrade secreting
23
+ ```
24
+
25
+ # Example:
26
+ ```python
27
+ salt() # Output: salt
28
+ sha256("a") # Output: hash
29
+ secure256("a") # Output: (hash, salt)
30
+ isEqual(1, 1) # Output: True
31
+ isEqual(1, 2) # Output: False
32
+ chars # Output: (ascii_letters, digits, punctuation)
33
+ tokenHex(32) # Output: token with 32 bytes
34
+ # And more nice tools!
35
+ ```
36
+ # Libs:
37
+ ## Secrets (choice, compare_digest)
38
+ ## Random (shuffle, random, randint)
39
+ ## String (ascii_letters, digits, punctuation)
40
+ ## Hashlib (sha256, sha512)
41
+
42
+ # Github
43
+ ## [My github account](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
44
+
45
+ # Random scheme
46
+ ## Secretting uses Chaos 20 system
47
+ ## How it works:
48
+ ```python
49
+ import random
50
+
51
+ def x_or_o():
52
+ return random.choice(["x", "o"])
53
+ def chaos20system(func):
54
+ return random.choice([func() for _ in range(20)]) # It can be anything. Example: ["x", "x", "o", "x", "o", "o", ...]
55
+
56
+ print(chaos20system(x_or_o)) # It is more random than classic choice.
57
+ ```
58
+
59
+ # Enjoy it!
60
+
61
+
62
+
63
+ hi''',
64
+ long_description_content_type='text/markdown',
65
+ install_requires=[],
66
+ packages=find_packages(),
67
+ )