codext 1.16.0__tar.gz → 1.16.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.
- {codext-1.16.0 → codext-1.16.1}/.github/workflows/python-package.yml +5 -0
- {codext-1.16.0 → codext-1.16.1}/PKG-INFO +75 -26
- {codext-1.16.0 → codext-1.16.1}/README.md +74 -25
- codext-1.16.1/src/codext/VERSION.txt +1 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/__common__.py +1 -1
- {codext-1.16.0 → codext-1.16.1}/src/codext/__init__.py +7 -7
- {codext-1.16.0 → codext-1.16.1}/src/codext.egg-info/PKG-INFO +75 -26
- codext-1.16.0/src/codext/VERSION.txt +0 -1
- {codext-1.16.0 → codext-1.16.1}/.coveragerc +0 -0
- {codext-1.16.0 → codext-1.16.1}/.github/ISSUE_TEMPLATE/add-encoding.yml +0 -0
- {codext-1.16.0 → codext-1.16.1}/.github/copilot-instructions.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/.github/prompts/add_codec.prompt.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/.github/pull_request_template.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/.gitignore +0 -0
- {codext-1.16.0 → codext-1.16.1}/.readthedocs.yml +0 -0
- {codext-1.16.0 → codext-1.16.1}/LICENSE +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/coverage.svg +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/mkdocs.yml +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/cli.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/css/extra.css +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/demos/using-bases.gif +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/demos/using-codext.gif +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/demos/using-debase.gif +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/base.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/binary.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/common.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/compressions.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/crypto.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/hashing.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/languages.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/others.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/stegano.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/enc/web.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/features.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/guessing.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/howto.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/img/banner.png +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/img/icon.png +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/img/logo.png +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/index.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/pages/manipulations.md +0 -0
- {codext-1.16.0 → codext-1.16.1}/docs/requirements.txt +0 -0
- {codext-1.16.0 → codext-1.16.1}/pyproject.toml +0 -0
- {codext-1.16.0 → codext-1.16.1}/pytest.ini +0 -0
- {codext-1.16.0 → codext-1.16.1}/requirements.txt +0 -0
- {codext-1.16.0 → codext-1.16.1}/setup.cfg +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/__info__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/base/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/base/_base.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/base/_base2n.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/base/base100.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/base/base122.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/base/base45.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/base/base85.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/base/base91.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/base/baseN.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/binary/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/binary/baudot.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/binary/bcd.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/binary/excess3.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/binary/gray.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/binary/manchester.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/binary/rotate.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/checksums/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/checksums/adler.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/checksums/crc.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/checksums/luhn.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/common/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/common/a1z26.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/common/cases.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/common/dummy.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/common/octal.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/common/ordinal.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/compressions/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/compressions/gzipp.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/compressions/lz77.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/compressions/lz78.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/compressions/pkzip.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/affine.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/atbash.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/bacon.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/barbie.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/citrix.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/polybius.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/railfence.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/rot.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/scytale.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/shift.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/vigenere.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/crypto/xor.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/hashing/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/hashing/blake.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/hashing/crypt.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/hashing/md.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/hashing/mmh3.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/hashing/sha.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/hashing/shake.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/braille.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/galactic.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/ipsum.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/leetspeak.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/morse.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/navajo.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/radio.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/southpark.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/tap.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/languages/tomtom.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/macros.json +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/others/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/others/dna.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/others/kbshift.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/others/letters.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/others/markdown.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/others/uuencode.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/stegano/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/stegano/hexagram.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/stegano/klopf.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/stegano/resistor.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/stegano/rick.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/stegano/sms.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/stegano/whitespace.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/web/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/web/html.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext/web/url.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext.egg-info/SOURCES.txt +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext.egg-info/dependency_links.txt +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext.egg-info/entry_points.txt +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext.egg-info/requires.txt +0 -0
- {codext-1.16.0 → codext-1.16.1}/src/codext.egg-info/top_level.txt +0 -0
- {codext-1.16.0 → codext-1.16.1}/tests/__init__.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/tests/test_base.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/tests/test_common.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/tests/test_generated.py +0 -0
- {codext-1.16.0 → codext-1.16.1}/tests/test_manual.py +0 -0
|
@@ -18,12 +18,14 @@ jobs:
|
|
|
18
18
|
runs-on: ubuntu-latest
|
|
19
19
|
outputs:
|
|
20
20
|
package: ${{ steps.pkg.outputs.package }}
|
|
21
|
+
pypi_url: ${{ steps.pkg.outputs.pypi_url }}
|
|
21
22
|
steps:
|
|
22
23
|
- name: Compute package name from the repository's
|
|
23
24
|
id: pkg
|
|
24
25
|
run: |
|
|
25
26
|
name="${GITHUB_REPOSITORY##*/}"
|
|
26
27
|
echo "package=${name#python-}" >> $GITHUB_OUTPUT
|
|
28
|
+
echo "pypi_url=https://pypi.org/p/${name#python-}" >> $GITHUB_OUTPUT
|
|
27
29
|
build:
|
|
28
30
|
needs: prepare
|
|
29
31
|
runs-on: ${{ matrix.os }}
|
|
@@ -96,6 +98,9 @@ jobs:
|
|
|
96
98
|
git commit -m "Update coverage badge"
|
|
97
99
|
git push origin coverage-badge --force
|
|
98
100
|
deploy:
|
|
101
|
+
environment:
|
|
102
|
+
name: pypi
|
|
103
|
+
url: ${{ needs.prepare.outputs.pypi_url }}
|
|
99
104
|
runs-on: ubuntu-latest
|
|
100
105
|
needs: [prepare, coverage]
|
|
101
106
|
steps:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codext
|
|
3
|
-
Version: 1.16.
|
|
3
|
+
Version: 1.16.1
|
|
4
4
|
Summary: Native codecs extension
|
|
5
5
|
Author-email: Alexandre D'Hondt <alexandre.dhondt@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -779,6 +779,8 @@ example-macro
|
|
|
779
779
|
|
|
780
780
|
## //img.shields.io/badge/Tweet%20(unbase)--lightgrey?logo=twitter&style=social" alt="Tweet on unbase" height="20"/></a>
|
|
781
781
|
|
|
782
|
+
Playing with base encodings.
|
|
783
|
+
|
|
782
784
|
```session
|
|
783
785
|
$ echo "Test string !" | base122
|
|
784
786
|
*.7!ft9�-f9Â
|
|
@@ -804,9 +806,63 @@ $ echo "Test string !" | base91 | base85 | base36 | base58-flickr | unbase -f Te
|
|
|
804
806
|
Test string !
|
|
805
807
|
```
|
|
806
808
|
|
|
809
|
+
## Usage (CLI)
|
|
810
|
+
|
|
811
|
+
Listing codecs.
|
|
812
|
+
|
|
813
|
+
```session
|
|
814
|
+
$ codext list encodings
|
|
815
|
+
a1z26 adler32 affine alternative-rot ascii
|
|
816
|
+
atbash autoclave bacon barbie base
|
|
817
|
+
base1 base2 base3 base4 base8
|
|
818
|
+
<<snipped>>
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
Finding a codec based on a name.
|
|
822
|
+
|
|
823
|
+
```session
|
|
824
|
+
$ codext search bitcoin
|
|
825
|
+
base58
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
Encoding a string.
|
|
829
|
+
|
|
830
|
+
```sesssion
|
|
831
|
+
$ echo -en "This is a test" | codext encode polybius
|
|
832
|
+
44232443 2443 11 44154344
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
Encoding a file.
|
|
836
|
+
|
|
837
|
+
```session
|
|
838
|
+
$ echo -en "this is a test" > to_be_encoded.txt
|
|
839
|
+
$ codext encode base64 < to_be_encoded.txt > text.b64
|
|
840
|
+
$ cat text.b64
|
|
841
|
+
dGhpcyBpcyBhIHRlc3Q=
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
Chaining codecs.
|
|
845
|
+
|
|
846
|
+
```session
|
|
847
|
+
$ echo -en "mrdvm6teie6t2cq=" | codext encode upper | codext decode base32 | codext decode base64
|
|
848
|
+
test
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
Iteratively guessing decodings.
|
|
852
|
+
|
|
853
|
+
```session
|
|
854
|
+
$ echo -en "test" | codext encode base64 gzip | codext guess
|
|
855
|
+
Codecs: gzip
|
|
856
|
+
dGVzdA==
|
|
857
|
+
$ echo -en "test" | codext encode base64 gzip | codext guess gzip -i base
|
|
858
|
+
Codecs: gzip, base64
|
|
859
|
+
test
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
|
|
807
863
|
## Usage (Python)
|
|
808
864
|
|
|
809
|
-
Getting the list of available codecs
|
|
865
|
+
Getting the list of available codecs.
|
|
810
866
|
|
|
811
867
|
```python
|
|
812
868
|
>>> import codext
|
|
@@ -814,6 +870,9 @@ Getting the list of available codecs:
|
|
|
814
870
|
>>> codext.list()
|
|
815
871
|
['ascii85', 'base85', 'base100', 'base122', ..., 'tomtom', 'dna', 'html', 'markdown', 'url', 'resistor', 'sms', 'whitespace', 'whitespace-after-before']
|
|
816
872
|
|
|
873
|
+
Playing with some base encodings.
|
|
874
|
+
|
|
875
|
+
```python
|
|
817
876
|
>>> codext.encode("this is a test", "base58-bitcoin")
|
|
818
877
|
'jo91waLQA1NNeBmZKUF'
|
|
819
878
|
|
|
@@ -828,7 +887,21 @@ Getting the list of available codecs:
|
|
|
828
887
|
|
|
829
888
|
>>> codecs.decode("👫👟👠👪🐗👠👪🐗👘🐗👫👜👪👫", "base100")
|
|
830
889
|
'this is a test'
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
Playing with some cryptography-based codecs.
|
|
831
893
|
|
|
894
|
+
```python
|
|
895
|
+
>>> codext.encode("This is a test !", "vigenere-MYSECRETKET")
|
|
896
|
+
'Ffaw kj e mowm !'
|
|
897
|
+
|
|
898
|
+
>>> codext.encode("This is a test !", "autoclave-SECRET")
|
|
899
|
+
'Llkj ml t amkb !'
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
Encoding/decoding with various other codecs.
|
|
903
|
+
|
|
904
|
+
```python
|
|
832
905
|
>>> for i in range(8):
|
|
833
906
|
print(codext.encode("this is a test", "dna-%d" % (i + 1)))
|
|
834
907
|
GTGAGCCAGCCGGTATACAAGCCGGTATACAAGCAGACAAGTGAGCGGGTATGTGA
|
|
@@ -856,30 +929,6 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
|
|
|
856
929
|
f.read()
|
|
857
930
|
'this is a test'
|
|
858
931
|
|
|
859
|
-
>>> codext.decode("""
|
|
860
|
-
=
|
|
861
|
-
X
|
|
862
|
-
:
|
|
863
|
-
x
|
|
864
|
-
n
|
|
865
|
-
r
|
|
866
|
-
y
|
|
867
|
-
Y
|
|
868
|
-
y
|
|
869
|
-
p
|
|
870
|
-
a
|
|
871
|
-
`
|
|
872
|
-
n
|
|
873
|
-
|
|
|
874
|
-
a
|
|
875
|
-
o
|
|
876
|
-
h
|
|
877
|
-
`
|
|
878
|
-
g
|
|
879
|
-
o
|
|
880
|
-
z """, "whitespace-after+before")
|
|
881
|
-
'CSC{not_so_invisible}'
|
|
882
|
-
|
|
883
932
|
>>> print(codext.encode("An example test string", "baudot-tape"))
|
|
884
933
|
***.**
|
|
885
934
|
. *
|
|
@@ -81,6 +81,8 @@ example-macro
|
|
|
81
81
|
|
|
82
82
|
## //img.shields.io/badge/Tweet%20(unbase)--lightgrey?logo=twitter&style=social" alt="Tweet on unbase" height="20"/></a>
|
|
83
83
|
|
|
84
|
+
Playing with base encodings.
|
|
85
|
+
|
|
84
86
|
```session
|
|
85
87
|
$ echo "Test string !" | base122
|
|
86
88
|
*.7!ft9�-f9Â
|
|
@@ -106,9 +108,63 @@ $ echo "Test string !" | base91 | base85 | base36 | base58-flickr | unbase -f Te
|
|
|
106
108
|
Test string !
|
|
107
109
|
```
|
|
108
110
|
|
|
111
|
+
## Usage (CLI)
|
|
112
|
+
|
|
113
|
+
Listing codecs.
|
|
114
|
+
|
|
115
|
+
```session
|
|
116
|
+
$ codext list encodings
|
|
117
|
+
a1z26 adler32 affine alternative-rot ascii
|
|
118
|
+
atbash autoclave bacon barbie base
|
|
119
|
+
base1 base2 base3 base4 base8
|
|
120
|
+
<<snipped>>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Finding a codec based on a name.
|
|
124
|
+
|
|
125
|
+
```session
|
|
126
|
+
$ codext search bitcoin
|
|
127
|
+
base58
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Encoding a string.
|
|
131
|
+
|
|
132
|
+
```sesssion
|
|
133
|
+
$ echo -en "This is a test" | codext encode polybius
|
|
134
|
+
44232443 2443 11 44154344
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Encoding a file.
|
|
138
|
+
|
|
139
|
+
```session
|
|
140
|
+
$ echo -en "this is a test" > to_be_encoded.txt
|
|
141
|
+
$ codext encode base64 < to_be_encoded.txt > text.b64
|
|
142
|
+
$ cat text.b64
|
|
143
|
+
dGhpcyBpcyBhIHRlc3Q=
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Chaining codecs.
|
|
147
|
+
|
|
148
|
+
```session
|
|
149
|
+
$ echo -en "mrdvm6teie6t2cq=" | codext encode upper | codext decode base32 | codext decode base64
|
|
150
|
+
test
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Iteratively guessing decodings.
|
|
154
|
+
|
|
155
|
+
```session
|
|
156
|
+
$ echo -en "test" | codext encode base64 gzip | codext guess
|
|
157
|
+
Codecs: gzip
|
|
158
|
+
dGVzdA==
|
|
159
|
+
$ echo -en "test" | codext encode base64 gzip | codext guess gzip -i base
|
|
160
|
+
Codecs: gzip, base64
|
|
161
|
+
test
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
|
|
109
165
|
## Usage (Python)
|
|
110
166
|
|
|
111
|
-
Getting the list of available codecs
|
|
167
|
+
Getting the list of available codecs.
|
|
112
168
|
|
|
113
169
|
```python
|
|
114
170
|
>>> import codext
|
|
@@ -116,6 +172,9 @@ Getting the list of available codecs:
|
|
|
116
172
|
>>> codext.list()
|
|
117
173
|
['ascii85', 'base85', 'base100', 'base122', ..., 'tomtom', 'dna', 'html', 'markdown', 'url', 'resistor', 'sms', 'whitespace', 'whitespace-after-before']
|
|
118
174
|
|
|
175
|
+
Playing with some base encodings.
|
|
176
|
+
|
|
177
|
+
```python
|
|
119
178
|
>>> codext.encode("this is a test", "base58-bitcoin")
|
|
120
179
|
'jo91waLQA1NNeBmZKUF'
|
|
121
180
|
|
|
@@ -130,7 +189,21 @@ Getting the list of available codecs:
|
|
|
130
189
|
|
|
131
190
|
>>> codecs.decode("👫👟👠👪🐗👠👪🐗👘🐗👫👜👪👫", "base100")
|
|
132
191
|
'this is a test'
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Playing with some cryptography-based codecs.
|
|
133
195
|
|
|
196
|
+
```python
|
|
197
|
+
>>> codext.encode("This is a test !", "vigenere-MYSECRETKET")
|
|
198
|
+
'Ffaw kj e mowm !'
|
|
199
|
+
|
|
200
|
+
>>> codext.encode("This is a test !", "autoclave-SECRET")
|
|
201
|
+
'Llkj ml t amkb !'
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Encoding/decoding with various other codecs.
|
|
205
|
+
|
|
206
|
+
```python
|
|
134
207
|
>>> for i in range(8):
|
|
135
208
|
print(codext.encode("this is a test", "dna-%d" % (i + 1)))
|
|
136
209
|
GTGAGCCAGCCGGTATACAAGCCGGTATACAAGCAGACAAGTGAGCGGGTATGTGA
|
|
@@ -158,30 +231,6 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
|
|
|
158
231
|
f.read()
|
|
159
232
|
'this is a test'
|
|
160
233
|
|
|
161
|
-
>>> codext.decode("""
|
|
162
|
-
=
|
|
163
|
-
X
|
|
164
|
-
:
|
|
165
|
-
x
|
|
166
|
-
n
|
|
167
|
-
r
|
|
168
|
-
y
|
|
169
|
-
Y
|
|
170
|
-
y
|
|
171
|
-
p
|
|
172
|
-
a
|
|
173
|
-
`
|
|
174
|
-
n
|
|
175
|
-
|
|
|
176
|
-
a
|
|
177
|
-
o
|
|
178
|
-
h
|
|
179
|
-
`
|
|
180
|
-
g
|
|
181
|
-
o
|
|
182
|
-
z """, "whitespace-after+before")
|
|
183
|
-
'CSC{not_so_invisible}'
|
|
184
|
-
|
|
185
234
|
>>> print(codext.encode("An example test string", "baudot-tape"))
|
|
186
235
|
***.**
|
|
187
236
|
. *
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.16.1
|
|
@@ -170,7 +170,7 @@ def main():
|
|
|
170
170
|
listi = sparsers.add_parser("list", help="list items")
|
|
171
171
|
lsparsers = listi.add_subparsers(dest="type", help="type of item to be listed", required=True)
|
|
172
172
|
liste = lsparsers.add_parser("encodings", help="list encodings")
|
|
173
|
-
liste.add_argument("category", nargs="
|
|
173
|
+
liste.add_argument("category", nargs="*", help="selected categories")
|
|
174
174
|
listm = lsparsers.add_parser("macros", help="list macros")
|
|
175
175
|
addm = sparsers.add_parser("add-macro", help="add a macro to the registry")
|
|
176
176
|
addm.add_argument("name", help="macro's name")
|
|
@@ -198,13 +198,13 @@ def main():
|
|
|
198
198
|
# list encodings or macros
|
|
199
199
|
elif args.command == "list":
|
|
200
200
|
if args.type == "encodings":
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if len(l) > 0:
|
|
205
|
-
if len(cats) > 0:
|
|
201
|
+
if args.category:
|
|
202
|
+
for c in sorted(args.category):
|
|
203
|
+
if len(l := list_encodings(c)) > 0:
|
|
206
204
|
print(c.upper() + ":")
|
|
207
|
-
|
|
205
|
+
__print_tabular(l)
|
|
206
|
+
else:
|
|
207
|
+
__print_tabular(list_encodings())
|
|
208
208
|
elif args.type == "macros":
|
|
209
209
|
l = list_macros()
|
|
210
210
|
if len(l) > 0:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codext
|
|
3
|
-
Version: 1.16.
|
|
3
|
+
Version: 1.16.1
|
|
4
4
|
Summary: Native codecs extension
|
|
5
5
|
Author-email: Alexandre D'Hondt <alexandre.dhondt@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -779,6 +779,8 @@ example-macro
|
|
|
779
779
|
|
|
780
780
|
## //img.shields.io/badge/Tweet%20(unbase)--lightgrey?logo=twitter&style=social" alt="Tweet on unbase" height="20"/></a>
|
|
781
781
|
|
|
782
|
+
Playing with base encodings.
|
|
783
|
+
|
|
782
784
|
```session
|
|
783
785
|
$ echo "Test string !" | base122
|
|
784
786
|
*.7!ft9�-f9Â
|
|
@@ -804,9 +806,63 @@ $ echo "Test string !" | base91 | base85 | base36 | base58-flickr | unbase -f Te
|
|
|
804
806
|
Test string !
|
|
805
807
|
```
|
|
806
808
|
|
|
809
|
+
## Usage (CLI)
|
|
810
|
+
|
|
811
|
+
Listing codecs.
|
|
812
|
+
|
|
813
|
+
```session
|
|
814
|
+
$ codext list encodings
|
|
815
|
+
a1z26 adler32 affine alternative-rot ascii
|
|
816
|
+
atbash autoclave bacon barbie base
|
|
817
|
+
base1 base2 base3 base4 base8
|
|
818
|
+
<<snipped>>
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
Finding a codec based on a name.
|
|
822
|
+
|
|
823
|
+
```session
|
|
824
|
+
$ codext search bitcoin
|
|
825
|
+
base58
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
Encoding a string.
|
|
829
|
+
|
|
830
|
+
```sesssion
|
|
831
|
+
$ echo -en "This is a test" | codext encode polybius
|
|
832
|
+
44232443 2443 11 44154344
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
Encoding a file.
|
|
836
|
+
|
|
837
|
+
```session
|
|
838
|
+
$ echo -en "this is a test" > to_be_encoded.txt
|
|
839
|
+
$ codext encode base64 < to_be_encoded.txt > text.b64
|
|
840
|
+
$ cat text.b64
|
|
841
|
+
dGhpcyBpcyBhIHRlc3Q=
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
Chaining codecs.
|
|
845
|
+
|
|
846
|
+
```session
|
|
847
|
+
$ echo -en "mrdvm6teie6t2cq=" | codext encode upper | codext decode base32 | codext decode base64
|
|
848
|
+
test
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
Iteratively guessing decodings.
|
|
852
|
+
|
|
853
|
+
```session
|
|
854
|
+
$ echo -en "test" | codext encode base64 gzip | codext guess
|
|
855
|
+
Codecs: gzip
|
|
856
|
+
dGVzdA==
|
|
857
|
+
$ echo -en "test" | codext encode base64 gzip | codext guess gzip -i base
|
|
858
|
+
Codecs: gzip, base64
|
|
859
|
+
test
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
|
|
807
863
|
## Usage (Python)
|
|
808
864
|
|
|
809
|
-
Getting the list of available codecs
|
|
865
|
+
Getting the list of available codecs.
|
|
810
866
|
|
|
811
867
|
```python
|
|
812
868
|
>>> import codext
|
|
@@ -814,6 +870,9 @@ Getting the list of available codecs:
|
|
|
814
870
|
>>> codext.list()
|
|
815
871
|
['ascii85', 'base85', 'base100', 'base122', ..., 'tomtom', 'dna', 'html', 'markdown', 'url', 'resistor', 'sms', 'whitespace', 'whitespace-after-before']
|
|
816
872
|
|
|
873
|
+
Playing with some base encodings.
|
|
874
|
+
|
|
875
|
+
```python
|
|
817
876
|
>>> codext.encode("this is a test", "base58-bitcoin")
|
|
818
877
|
'jo91waLQA1NNeBmZKUF'
|
|
819
878
|
|
|
@@ -828,7 +887,21 @@ Getting the list of available codecs:
|
|
|
828
887
|
|
|
829
888
|
>>> codecs.decode("👫👟👠👪🐗👠👪🐗👘🐗👫👜👪👫", "base100")
|
|
830
889
|
'this is a test'
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
Playing with some cryptography-based codecs.
|
|
831
893
|
|
|
894
|
+
```python
|
|
895
|
+
>>> codext.encode("This is a test !", "vigenere-MYSECRETKET")
|
|
896
|
+
'Ffaw kj e mowm !'
|
|
897
|
+
|
|
898
|
+
>>> codext.encode("This is a test !", "autoclave-SECRET")
|
|
899
|
+
'Llkj ml t amkb !'
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
Encoding/decoding with various other codecs.
|
|
903
|
+
|
|
904
|
+
```python
|
|
832
905
|
>>> for i in range(8):
|
|
833
906
|
print(codext.encode("this is a test", "dna-%d" % (i + 1)))
|
|
834
907
|
GTGAGCCAGCCGGTATACAAGCCGGTATACAAGCAGACAAGTGAGCGGGTATGTGA
|
|
@@ -856,30 +929,6 @@ CACTCGGTCGGCCATATGTTCGGCCATATGTTCGTCTGTTCACTCGCCCATACACT
|
|
|
856
929
|
f.read()
|
|
857
930
|
'this is a test'
|
|
858
931
|
|
|
859
|
-
>>> codext.decode("""
|
|
860
|
-
=
|
|
861
|
-
X
|
|
862
|
-
:
|
|
863
|
-
x
|
|
864
|
-
n
|
|
865
|
-
r
|
|
866
|
-
y
|
|
867
|
-
Y
|
|
868
|
-
y
|
|
869
|
-
p
|
|
870
|
-
a
|
|
871
|
-
`
|
|
872
|
-
n
|
|
873
|
-
|
|
|
874
|
-
a
|
|
875
|
-
o
|
|
876
|
-
h
|
|
877
|
-
`
|
|
878
|
-
g
|
|
879
|
-
o
|
|
880
|
-
z """, "whitespace-after+before")
|
|
881
|
-
'CSC{not_so_invisible}'
|
|
882
|
-
|
|
883
932
|
>>> print(codext.encode("An example test string", "baudot-tape"))
|
|
884
933
|
***.**
|
|
885
934
|
. *
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.16.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|