Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
99b11e6e
Commit
99b11e6e
authored
Sep 04, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1c1c40cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
go/neo/t/zsha1.py
go/neo/t/zsha1.py
+36
-0
No files found.
go/neo/t/zsha1.py
0 → 100755
View file @
99b11e6e
#!/usr/bin/env python
"""zsha1 - compute sha1 of whole latest objects stream in a ZODB database"""
import
zodbtools.util
from
ZODB.POSException
import
POSKeyError
from
ZODB.utils
import
p64
,
u64
import
hashlib
import
sys
def
main
():
url
=
sys
.
argv
[
1
]
stor
=
zodbtools
.
util
.
storageFromURL
(
url
,
read_only
=
True
)
last_tid
=
stor
.
lastTransaction
()
before
=
p64
(
u64
(
last_tid
)
+
1
)
m
=
hashlib
.
sha1
()
oid
=
0
while
1
:
try
:
data
,
serial
,
_
=
stor
.
loadBefore
(
p64
(
oid
),
before
)
except
POSKeyError
:
break
#print('%s @%s' % (oid, u64(serial)))
m
.
update
(
data
)
oid
+=
1
print
(
'%s ; oid=0..%d'
%
(
m
.
hexdigest
(),
oid
-
1
))
if
__name__
==
'__main__'
:
main
()
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