Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
15570825
Commit
15570825
authored
Mar 06, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
21220f75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
27 deletions
+1
-27
go/neo/t/tcpu.py
go/neo/t/tcpu.py
+1
-27
No files found.
go/neo/t/tcpu.py
View file @
15570825
...
...
@@ -25,37 +25,11 @@ from __future__ import print_function
import
sys
import
hashlib
import
zlib
from
zlib
import
crc32
,
adler32
from
os.path
import
dirname
from
zodbtools.util
import
Adler32Hasher
,
CRC32Hasher
from
golang
import
testing
# adler32 in hashlib interface
class
Adler32Hasher
:
name
=
"adler32"
def
__init__
(
self
):
self
.
h
=
adler32
(
''
)
def
update
(
self
,
data
):
self
.
h
=
adler32
(
data
,
self
.
h
)
def
hexdigest
(
self
):
return
'%08x'
%
(
self
.
h
&
0xffffffff
)
# crc32 in hashlib interface
class
CRC32Hasher
:
name
=
"crc32"
def
__init__
(
self
):
self
.
h
=
crc32
(
''
)
def
update
(
self
,
data
):
self
.
h
=
crc32
(
data
,
self
.
h
)
def
hexdigest
(
self
):
return
'%08x'
%
(
self
.
h
&
0xffffffff
)
# fmtsize formats size in human readable form
_unitv
=
"BKMGT"
# (2^10)^i represents by corresponding char suffix
def
fmtsize
(
size
):
...
...
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