How do I format an MD5 hash with dashes between pairs of digits in python?
For example, I can generate a hex string like this:
from hashlib import md5
print md5("Testing123!").hexdigest()
Which gives this output:
b8f58c3067916bbfb50766aa8bddd42c
How can I format the output like this:
B8-F5-8C-30-67-91-6B-BF-B5-07-66-AA-8B-DD-D4-2C
(Note: This is to match the format used by the ASP.NET Membership Provider to store password hashes in the database, so I can interface with it from Python.)