Yet Another WebIOPi+
Main Page
Related Pages
Packages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Macros
Pages
python
webiopi
utils
crypto.py
Go to the documentation of this file.
1
import
base64
2
import
hashlib
3
from
webiopi.utils.version
import
PYTHON_MAJOR
4
5
def
encodeCredentials
(login, password):
6
abcd =
"%s:%s"
% (login, password)
7
if
PYTHON_MAJOR >= 3:
8
b = base64.b64encode(abcd.encode())
9
else
:
10
b = base64.b64encode(abcd)
11
return
b
12
13
def
encrypt
(value):
14
return
hashlib.sha256(value).hexdigest()
15
16
def
encryptCredentials
(login, password):
17
return
encrypt
(
encodeCredentials
(login, password))
webiopi.utils.crypto.encryptCredentials
def encryptCredentials
Definition:
crypto.py:16
webiopi.utils.version
Definition:
version.py:1
webiopi.utils.crypto.encodeCredentials
def encodeCredentials
Definition:
crypto.py:5
webiopi.utils.crypto.encrypt
def encrypt
Definition:
crypto.py:13
Generated on Sat Sep 10 2016 09:37:18 for Yet Another WebIOPi+ by
1.8.8