Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f64509e3
Commit
f64509e3
authored
Apr 24, 2003
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move all the imports to the top; use md5.new()
parent
30dd9bc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
Demo/md5test/md5driver.py
Demo/md5test/md5driver.py
+6
-8
No files found.
Demo/md5test/md5driver.py
View file @
f64509e3
import
string
import
md5
from
sys
import
argv
def
MDPrint
(
str
):
outstr
=
''
...
...
@@ -20,8 +22,6 @@ def makestr(start, end):
return
result
from
md5
import
md5
def
MDTimeTrial
():
TEST_BLOCK_SIZE
=
1000
TEST_BLOCKS
=
10000
...
...
@@ -42,7 +42,7 @@ def MDTimeTrial():
print
'MD5 time trial. Processing'
,
TEST_BYTES
,
'characters...'
t1
=
time
()
mdContext
=
md5
()
mdContext
=
md5
.
new
()
for
i
in
range
(
TEST_BLOCKS
):
mdContext
.
update
(
data
)
...
...
@@ -57,13 +57,13 @@ def MDTimeTrial():
def
MDString
(
str
):
MDPrint
(
md5
(
str
).
digest
())
MDPrint
(
md5
.
new
(
str
).
digest
())
print
'"'
+
str
+
'"'
def
MDFile
(
filename
):
f
=
open
(
filename
,
'rb'
);
mdContext
=
md5
()
mdContext
=
md5
.
new
()
while
1
:
data
=
f
.
read
(
1024
)
...
...
@@ -78,7 +78,7 @@ def MDFile(filename):
import
sys
def
MDFilter
():
mdContext
=
md5
()
mdContext
=
md5
.
new
()
while
1
:
data
=
sys
.
stdin
.
read
(
16
)
...
...
@@ -106,8 +106,6 @@ def MDTestSuite():
MDFile
(
'foo'
)
from
sys
import
argv
# I don't wanna use getopt(), since I want to use the same i/f...
def
main
():
if
len
(
argv
)
==
1
:
...
...
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