Metadata-Version: 2.1
Name: indecode
Version: 1.4.1
Summary: Code and decode string
Author: lolo859
License: UNKNOWN
Keywords: code,incode,indecode,decode,incode,indc
Platform: UNKNOWN
Classifier: Natural Language :: French
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Code Generators
Description-Content-Type: #Install and import
Requires-Dist: docutils (>=0.3)

For install indecode : 

~~~shell
pip install indecode
~~~

For import indecode :

~~~python
import indecode
~~~

#Functions

This module contain three functions :

- generate_key() - return string

~~~python
import indecode
key=indecode.generate_key()
~~~

- code(text to code in str, key return by the "generate_key()" function) - return string

~~~python
import indecode
key=indecode.generate_key()
text="hello world"
incode=indecode.code(text,key)
print(incode)
~~~

- decode(text return by the "code()" function, key return by the "generate_key()" function) - return string

~~~python
import indecode
key=indecode.generate_key()
text="hello world"
incode=indecode.code(text,key)
print(incode)
uncode=indecode.decode(incode,key)
print(uncode)
~~~

#Error

The indecode module can trigger the following errors :

- TypeError : one of the arguments is not a string

~~~
>>> indecode.code(1,key)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/Documents/indecode/indecode.py", line 24, in code
    raise TypeError("text argument must be a string")
TypeError: text argument must be a string
~~~

- CodeError : one of the caracters in the text argument is not encodable

~~~
>>> indecode.code("<",key)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/Documents/indecode/indecode.py", line 38, in code
    raise CodeError("'"+text[i]+"' is not encodable.")
indecode.CodeError: '<' is not encodable.
~~~

- DecodeError : one of the caracters in the text argument is not decodable

~~~
>>> indecode.decode(">",key)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/Documents/indecode/indecode.py", line 59, in decode
    raise DecodeError("'"+text[i]+"' is not decodable.")
indecode.DecodeError: '>' is not decodable.
~~~

- KeyElementError : one of the caracters in the key argument must not be in the key

~~~
>>> print(key)
KBm%z5oèëMUaEPY\ldxn@98Hyà:T;N2we)DGZ[°W{JF(s}r-çiS§*,4.b60µ!t&ùVvI3#C]?7Aê£hQ=gu~f+1_Xq^"$péOjLk/c<
>>> indecode.code("hello world",key)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/Documents/indecode/indecode.py", line 32, in code
    raise KeyElementError("'"+keylist[i]+"' must not be in the key.")
indecode.KeyElementError: '<' must not be in the key.
~~~

- KeyLengthError : the key is not of the expected length.

~~~
>>> indecode.code("hello world",key="a")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/Documents/indecode/indecode.py", line 29, in code
    raise KeyLengthError("the key is not of the expected length.")
indecode.KeyLengthError: the key is not of the expected length.
~~~

UNKNOWN

