9 # Fast hashing of files.
10 # Initial implementation isn't intended to be fast, just work.
13 # - Use mmap() in cases where that would work. Not sure this would
14 # really be any faster.
15 # - Optionally bind to faster MD5 library.
17 # When running on Linux, and root, avoid updating the atime of the
20 if platform
.system() == 'Linux' and os
.getuid() == 0:
21 extra_flags
= 01000000
24 ufd
= os
.open(path
, os
.O_RDONLY | extra_flags
)
25 fd
= os
.fdopen(ufd
, 'rb', 0)
26 # fd = open(path, 'rb')
36 if __name__
== '__main__':
37 for name
in sys
.argv
[1:]:
38 print ("%s %s" % (base64
.b16encode(hashof(name
)), name
))