pystringmath 1.2.0__tar.gz → 1.3.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.
- {pystringmath-1.2.0 → pystringmath-1.3.1}/PKG-INFO +33 -1
- {pystringmath-1.2.0 → pystringmath-1.3.1}/README.md +32 -0
- {pystringmath-1.2.0 → pystringmath-1.3.1}/pystringmath/main.py +16 -6
- {pystringmath-1.2.0 → pystringmath-1.3.1}/pystringmath.egg-info/PKG-INFO +33 -1
- {pystringmath-1.2.0 → pystringmath-1.3.1}/setup.py +1 -1
- {pystringmath-1.2.0 → pystringmath-1.3.1}/LICENSE +0 -0
- {pystringmath-1.2.0 → pystringmath-1.3.1}/pystringmath/__init__.py +0 -0
- {pystringmath-1.2.0 → pystringmath-1.3.1}/pystringmath.egg-info/SOURCES.txt +0 -0
- {pystringmath-1.2.0 → pystringmath-1.3.1}/pystringmath.egg-info/dependency_links.txt +0 -0
- {pystringmath-1.2.0 → pystringmath-1.3.1}/pystringmath.egg-info/top_level.txt +0 -0
- {pystringmath-1.2.0 → pystringmath-1.3.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pystringmath
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: Package for string maths
|
|
5
5
|
Home-page: https://github.com/shTrueDDel/pystringmath/
|
|
6
6
|
Author: shTrueDDel
|
|
@@ -27,9 +27,12 @@ Dynamic: summary
|
|
|
27
27
|
|
|
28
28
|
# String Arithmetic Library
|
|
29
29
|
|
|
30
|
+
[GitHub](https://github.com/shTrueDDel/pystringmath)
|
|
31
|
+
|
|
30
32
|
*This documentation was translated and compiled with the help of AI. Examples may contain minor errors that do not affect the understanding of how it works.*
|
|
31
33
|
|
|
32
34
|
## Overview
|
|
35
|
+
|
|
33
36
|
The library provides tools for performing arithmetic operations on strings by converting characters to their numeric codes (ASCII/Unicode) and back. It allows adding, subtracting, multiplying, and dividing strings with both numbers and other strings.
|
|
34
37
|
|
|
35
38
|
---
|
|
@@ -292,6 +295,35 @@ Element-wise integer division of first string character codes by second string c
|
|
|
292
295
|
|
|
293
296
|
---
|
|
294
297
|
|
|
298
|
+
## Class `crypto`
|
|
299
|
+
Basic encrypt and decrypt functions for prototyping and testing
|
|
300
|
+
|
|
301
|
+
### General Features
|
|
302
|
+
- Basic encrypt and decrypt functions
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
#### `.xor(data, key)`
|
|
307
|
+
XOR enctypting and decrypting
|
|
308
|
+
|
|
309
|
+
**Parameters:**
|
|
310
|
+
- `data` (str or list) - first string
|
|
311
|
+
- `key` (str or list) - second string (addend)
|
|
312
|
+
|
|
313
|
+
**Returns:**
|
|
314
|
+
- str - resulting string
|
|
315
|
+
|
|
316
|
+
**Example:**
|
|
317
|
+
```python
|
|
318
|
+
>>> crypto.xor('Test text', 'key')
|
|
319
|
+
?
|
|
320
|
+
E
|
|
321
|
+
>>> crypto.xor(crypto.xor('Test text', 'key'), 'key')
|
|
322
|
+
Test text
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
295
327
|
## Usage Examples
|
|
296
328
|
|
|
297
329
|
### Basic Operations
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# String Arithmetic Library
|
|
2
2
|
|
|
3
|
+
[GitHub](https://github.com/shTrueDDel/pystringmath)
|
|
4
|
+
|
|
3
5
|
*This documentation was translated and compiled with the help of AI. Examples may contain minor errors that do not affect the understanding of how it works.*
|
|
4
6
|
|
|
5
7
|
## Overview
|
|
8
|
+
|
|
6
9
|
The library provides tools for performing arithmetic operations on strings by converting characters to their numeric codes (ASCII/Unicode) and back. It allows adding, subtracting, multiplying, and dividing strings with both numbers and other strings.
|
|
7
10
|
|
|
8
11
|
---
|
|
@@ -265,6 +268,35 @@ Element-wise integer division of first string character codes by second string c
|
|
|
265
268
|
|
|
266
269
|
---
|
|
267
270
|
|
|
271
|
+
## Class `crypto`
|
|
272
|
+
Basic encrypt and decrypt functions for prototyping and testing
|
|
273
|
+
|
|
274
|
+
### General Features
|
|
275
|
+
- Basic encrypt and decrypt functions
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
#### `.xor(data, key)`
|
|
280
|
+
XOR enctypting and decrypting
|
|
281
|
+
|
|
282
|
+
**Parameters:**
|
|
283
|
+
- `data` (str or list) - first string
|
|
284
|
+
- `key` (str or list) - second string (addend)
|
|
285
|
+
|
|
286
|
+
**Returns:**
|
|
287
|
+
- str - resulting string
|
|
288
|
+
|
|
289
|
+
**Example:**
|
|
290
|
+
```python
|
|
291
|
+
>>> crypto.xor('Test text', 'key')
|
|
292
|
+
?
|
|
293
|
+
E
|
|
294
|
+
>>> crypto.xor(crypto.xor('Test text', 'key'), 'key')
|
|
295
|
+
Test text
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
268
300
|
## Usage Examples
|
|
269
301
|
|
|
270
302
|
### Basic Operations
|
|
@@ -86,8 +86,15 @@ class armath:
|
|
|
86
86
|
raise ZeroDivisionError('Error! Division by zero!')
|
|
87
87
|
r = [a // b for a, b in zip(data, cycle(div))]
|
|
88
88
|
return to.chars(r)
|
|
89
|
+
|
|
90
|
+
class crypto:
|
|
91
|
+
def xor (data, key):
|
|
92
|
+
data = to.non_safe_array(data)
|
|
93
|
+
key = to.non_safe_array(key)
|
|
94
|
+
r = [a ^ b for a, b in zip(data, cycle(key))]
|
|
95
|
+
return to.chars(r)
|
|
89
96
|
|
|
90
|
-
""" # Tests
|
|
97
|
+
# """ # Tests
|
|
91
98
|
print('to.array: ', to.array('Test'))
|
|
92
99
|
print('to.chars: ', to.chars(to.array('Test')))
|
|
93
100
|
print('non_safe_array: ', to.chars(to.non_safe_array([65, 66, 67])), '\n')
|
|
@@ -97,8 +104,11 @@ print('nmath.min: ', nmath.min('Test', 5), '\tTest')
|
|
|
97
104
|
print('nmath.mul: ', nmath.mul('Test', 5), '\tTest')
|
|
98
105
|
print('nmath.div: ', nmath.div('Test', 5), '\tTest')
|
|
99
106
|
|
|
100
|
-
print('armath.sum: ', armath.sum('Test', '
|
|
101
|
-
print('armath.min: ', armath.min('Test', '
|
|
102
|
-
print('armath.mul: ', armath.mul('Test', '
|
|
103
|
-
print('armath.div: ', armath.div('Test', '
|
|
104
|
-
|
|
107
|
+
print('armath.sum: ', armath.sum('Test', 'A'), '\tTest\tA')
|
|
108
|
+
print('armath.min: ', armath.min('Test', 'A'), '\tTest\tA')
|
|
109
|
+
print('armath.mul: ', armath.mul('Test', 'A'), '\tTest\tA')
|
|
110
|
+
print('armath.div: ', armath.div('Test', 'A'), '\tTest\tA\n')
|
|
111
|
+
|
|
112
|
+
print('crypto.xor: ', crypto.xor('Test text', 'key'))
|
|
113
|
+
print('crypto.xor x2: ', crypto.xor(crypto.xor('Test text', 'key'), 'key'))
|
|
114
|
+
# """ # Tests
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pystringmath
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: Package for string maths
|
|
5
5
|
Home-page: https://github.com/shTrueDDel/pystringmath/
|
|
6
6
|
Author: shTrueDDel
|
|
@@ -27,9 +27,12 @@ Dynamic: summary
|
|
|
27
27
|
|
|
28
28
|
# String Arithmetic Library
|
|
29
29
|
|
|
30
|
+
[GitHub](https://github.com/shTrueDDel/pystringmath)
|
|
31
|
+
|
|
30
32
|
*This documentation was translated and compiled with the help of AI. Examples may contain minor errors that do not affect the understanding of how it works.*
|
|
31
33
|
|
|
32
34
|
## Overview
|
|
35
|
+
|
|
33
36
|
The library provides tools for performing arithmetic operations on strings by converting characters to their numeric codes (ASCII/Unicode) and back. It allows adding, subtracting, multiplying, and dividing strings with both numbers and other strings.
|
|
34
37
|
|
|
35
38
|
---
|
|
@@ -292,6 +295,35 @@ Element-wise integer division of first string character codes by second string c
|
|
|
292
295
|
|
|
293
296
|
---
|
|
294
297
|
|
|
298
|
+
## Class `crypto`
|
|
299
|
+
Basic encrypt and decrypt functions for prototyping and testing
|
|
300
|
+
|
|
301
|
+
### General Features
|
|
302
|
+
- Basic encrypt and decrypt functions
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
#### `.xor(data, key)`
|
|
307
|
+
XOR enctypting and decrypting
|
|
308
|
+
|
|
309
|
+
**Parameters:**
|
|
310
|
+
- `data` (str or list) - first string
|
|
311
|
+
- `key` (str or list) - second string (addend)
|
|
312
|
+
|
|
313
|
+
**Returns:**
|
|
314
|
+
- str - resulting string
|
|
315
|
+
|
|
316
|
+
**Example:**
|
|
317
|
+
```python
|
|
318
|
+
>>> crypto.xor('Test text', 'key')
|
|
319
|
+
?
|
|
320
|
+
E
|
|
321
|
+
>>> crypto.xor(crypto.xor('Test text', 'key'), 'key')
|
|
322
|
+
Test text
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
295
327
|
## Usage Examples
|
|
296
328
|
|
|
297
329
|
### Basic Operations
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|