add some functions
This commit is contained in:
commit
ef59090610
11 changed files with 649 additions and 0 deletions
17
oxutils/hashes.py
Normal file
17
oxutils/hashes.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=2:sts=2:ts=2
|
||||
# GPL written 2008 by j@pad.ma
|
||||
import sha
|
||||
import os
|
||||
|
||||
def sha1sum(filename):
|
||||
sha1 = sha.new()
|
||||
file=open(filename)
|
||||
buffer=file.read(4096)
|
||||
while buffer:
|
||||
sha1.update(buffer)
|
||||
buffer=file.read(4096)
|
||||
file.close()
|
||||
return sha1.hexdigest()
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue