Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
evm-store
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanli
evm-store
Commits
7da5d585
Commit
7da5d585
authored
Apr 14, 2021
by
wanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
ec21ca71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
backend/utils/__init__.py
backend/utils/__init__.py
+2
-3
backend/utils/epk.py
backend/utils/epk.py
+4
-2
No files found.
backend/utils/__init__.py
View file @
7da5d585
...
...
@@ -15,8 +15,6 @@ import threading
import
decimal
import
uuid
from
app.setting
import
config
class
DecimalEncoder
(
json
.
JSONEncoder
):
def
default
(
self
,
o
):
if
isinstance
(
o
,
decimal
.
Decimal
):
...
...
@@ -118,7 +116,7 @@ def writeFile(fpath, result):
f
.
write
(
result
)
def
md5_salt
(
s
):
md5
=
hashlib
.
md5
(
config
[
'MD5_SALT'
]
.
encode
(
"utf-8"
))
md5
=
hashlib
.
md5
(
"EhuqUkwV"
.
encode
(
"utf-8"
))
md5
.
update
(
s
.
encode
(
'utf-8'
))
return
md5
.
hexdigest
()
...
...
@@ -149,4 +147,5 @@ def get_days_before_datetime(dt, dayAgo):
return
dayAgo
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
if
__name__
==
"__main__"
:
print
(
os
.
path
.
abspath
(
__file__
))
print
(
random_string
(
7
))
\ No newline at end of file
backend/utils/epk.py
View file @
7da5d585
...
...
@@ -14,10 +14,12 @@ import hashlib
from
ctypes
import
*
import
platform
current_abspath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
platform
.
system
()
==
'Windows'
:
pDll
=
CDLL
(
"lib/eheatshrink.dll"
)
pDll
=
CDLL
(
os
.
sep
.
join
([
current_abspath
,
"lib"
,
"eheatshrink.dll"
])
)
elif
platform
.
system
()
==
'Linux'
:
pDll
=
CDLL
(
"lib/libeheatshrink.so"
)
pDll
=
CDLL
(
os
.
sep
.
join
([
current_abspath
,
"lib"
,
"libeheatshrink.so"
])
)
pDll
.
ecompress_size
.
restype
=
c_uint32
pDll
.
ecompress_size
.
argtypes
=
[
c_void_p
,
c_uint32
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment