On 01/21/2016 08:36 PM, Simon Glass wrote:
Hi Stephen,
On 20 January 2016 at 15:15, Stephen Warren <swar...@wwwdotorg.org> wrote:
From: Stephen Warren <swar...@nvidia.com>
Add various common utility functions. These will be used by a forthcoming
re-written UMS test, and a brand-new DFU test.
diff --git a/test/py/u_boot_utils.py b/test/py/u_boot_utils.py
+def md5sum_data(data):
+ '''Calculate the MD5 hash of some data.
+
+ Args:
+ data: The data to hash.
+
+ Returns:
+ The hash of the data, as a binary string.
+ '''
+
+ h = hashlib.md5()
+ h.update(data)
+ return h.digest()
Or just:
return hashlib.md5().update(data).digest()
I was going to do that, but it doesn't look like update() returns the
hash object, so I can't chain at least the .digest() call together, so I
may as well leave it as-is.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot