hashlib in one line

J. Gerlach gerlach_joerg at web.de
Mon Nov 29 08:54:58 EST 2010


Am 29.11.2010 14:50, schrieb Thomas Guettler:
> Hi,
> 
> I think it would be nice if you could use the hashlib in one line:
> 
> hashlib.sha256().update('abc').hexdigest()
> 
> Unfortunately update() returns None.
> 
> Is there a way to convert a string to the hexdigest of sha256 in one line?
> 
>   Thomas
> 
> 
Yeah, something like this would be nice: ;)

    hashlib.sha256('abc').hexdigest()

(tested in 2.6.6)



More information about the Python-list mailing list