/usr/share/pyshared/ncrypt/test/sha1hash.py is in python-ncrypt 0.6.4-0ubuntu8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import sys
from ncrypt import digest
def main() :
if len(sys.argv) != 2 :
print 'usage: sha1hash <file>'
return
fileName = sys.argv[1]
dt = digest.DigestType( 'SHA1' )
d = digest.Digest( dt )
hash = d.digest( file(sys.argv[1],'rb').read() )
print hash.encode('hex')
if __name__ == '__main__' :
main()
|