Skip to content

Commit c9514ce

Browse files
committed
minor cosmetic tweaks
1 parent e04ff67 commit c9514ce

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

bindings/python/argon2.py

+23-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
from ctypes import *
2-
import sys
3-
import platform
1+
#!/usr/bin/env python
2+
3+
from ctypes import cdll, c_uint32, c_char_p, c_size_t, c_int, create_string_buffer
44
import os
5+
import platform
6+
import sys
57

68

7-
system_type = platform.system()
9+
SYSTEM_TYPE = platform.system()
810
IS_PY2 = sys.version_info < (3, 0, 0, 'final', 0)
911
LOCAL_LIB_PATH = "../../"
1012

11-
if system_type == "Linux":
13+
if SYSTEM_TYPE == "Linux":
1214
LIB_NAME = "libargon2.so"
13-
elif system_type == "Windows":
15+
elif SYSTEM_TYPE == "Windows":
1416
LIB_NAME = "libargon2.dll"
15-
elif system_type == "Darwin":
17+
elif SYSTEM_TYPE == "Darwin":
1618
LIB_NAME = "libargon2.dylib"
1719
else:
18-
raise OSError("Your operating systems is not fully supported, you may try to modify code manually")
20+
raise OSError("Your OS is not fully supported, you may try to modify code manually")
1921

2022
try:
2123
GLOBAL_LIB_PATH = os.environ['LD_LIBRARY_PATH']
@@ -28,24 +30,24 @@
2830

2931
_crypto_argon2 = _argon2.argon2_hash
3032
_crypto_argon2.argtypes = [
31-
c_uint32, # uint32_t N
32-
c_uint32, # uint32_t r
33-
c_uint32, # uint32_t p
33+
c_uint32, # uint32_t N
34+
c_uint32, # uint32_t r
35+
c_uint32, # uint32_t p
3436

35-
c_char_p, # const uint8_t *passwd
36-
c_size_t, # size_t passwdlen
37+
c_char_p, # const uint8_t *passwd
38+
c_size_t, # size_t passwdlen
3739

38-
c_char_p, # const uint8_t *salt
39-
c_size_t, # size_t saltlen
40+
c_char_p, # const uint8_t *salt
41+
c_size_t, # size_t saltlen
4042

41-
c_char_p, # uint8_t *buf
42-
c_size_t, # size_t buflen
43+
c_char_p, # uint8_t *buf
44+
c_size_t, # size_t buflen
4345

44-
c_char_p, # uint8_t *encoded
45-
c_size_t, # size_t encodedlen
46+
c_char_p, # uint8_t *encoded
47+
c_size_t, # size_t encodedlen
4648

47-
c_uint32, # uint32_t Argon_type
48-
]
49+
c_uint32, # uint32_t Argon_type
50+
]
4951
_crypto_argon2.restype = c_int
5052

5153

0 commit comments

Comments
 (0)