"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> I see that Python supports the sha-1. But I need to make sha value in
> big files to (swap file, iso-s, etc.). Possible that file size more
> than 2 GB, so  I cannot read as string...
> How to get the sha value of a file ?

Use the sha.update method.  Something like:
  ctx = sha.new()
  while True:
    x = f.read(16384)
    if not x: break
    ctx.update(x)
  hash = ctx.digest()

> How to generate sha-256, or sha-512 values ?

There are some modules around for this.  Unless you're trying to
interoperate with something that needs them, or have some other reason
to want them, I wouldn't bother.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to