module documentation

Utility functions for hashing.

Function FingerprintFiles Compute fingerprints for a list of files.
Function Sha1Hmac Calculates the HMAC-SHA1 digest of a message.
Function VerifySha1Hmac Verifies the HMAC-SHA1 digest of a text.
Function _FingerprintFile Compute the fingerprint of a file.
def FingerprintFiles(files):

Compute fingerprints for a list of files.

Parameters
files:listthe list of filename to fingerprint
Returns
dicta dictionary filename: fingerprint, holding only existing files
def Sha1Hmac(key, msg, salt=None):

Calculates the HMAC-SHA1 digest of a message.

HMAC is defined in RFC2104.

Parameters
key:stringSecret key
msg:string or bytesUndocumented
saltUndocumented
def VerifySha1Hmac(key, text, digest, salt=None):

Verifies the HMAC-SHA1 digest of a text.

HMAC is defined in RFC2104.

Parameters
key:stringSecret key
text:stringUndocumented
digest:stringExpected digest
saltUndocumented
Returns
boolWhether HMAC-SHA1 digest matches
def _FingerprintFile(filename):

Compute the fingerprint of a file.

If the file does not exist, a None will be returned instead.

Parameters
filename:strthe filename to checksum
Returns
strthe hex digest of the sha checksum of the contents of the file