md5

MD5: Why am I getting different results for the same string?

MD5: Why am I getting different results for the same string? Question: I expected the following code to return the same result in each case since the string values are the same but instead got a different result each time. What can I do (if anything) to address this? import hashlib a = ‘some text’ …

Total answers: 1

How do I know if the 'usedforsecurity' flag is supported by hashlib.md5?

How do I know if the 'usedforsecurity' flag is supported by hashlib.md5? Question: When I run the following on my Macbook, I get the error: >>> import hashlib >>> hashlib.md5(usedforsecurity=False) Traceback (most recent call last): File “<stdin>”, line 1, in <module> TypeError: openssl_md5() takes no keyword arguments But when I run it on my Linux …

Total answers: 3

Fast way to md5 each element of a numpy array

Fast way to md5 each element of a numpy array Question: I am woring with a numpy’s 1d array with thousands of uint64 numbers in python 2.7. What is the fastest way to calculate the md5 of every number individually? Each number has to be converted to string before calling the md5 function. I read …

Total answers: 3

Generate md5 hash of JSON and compare in Python and JavaScript

Generate md5 hash of JSON and compare in Python and JavaScript Question: I have a use case where i have to generate md5 hash of a JSON object and compare the hashes in the server and the browser. The browser client generates hash and then asks the server for the hash of the same resource[ …

Total answers: 2

Generating one MD5/SHA1 checksum of multiple files in Python

Generating one MD5/SHA1 checksum of multiple files in Python Question: I have looked through several topics about calculating checksums of files in Python but none of them answered the question about one sum from multiple files. I have several files in sub directories and would like to determine if there was any change in one …

Total answers: 3

How do I calculate the MD5 checksum of a file in Python?

How do I calculate the MD5 checksum of a file in Python? Question: I have written some code in Python that checks for an MD5 hash in a file and makes sure the hash matches that of the original. Here is what I have developed: # Defines filename filename = "file.exe" # Gets MD5 from …

Total answers: 4

Is it ok to remove the equal signs from a base64 string?

Is it ok to remove the equal signs from a base64 string? Question: I have a string that I’m encoding into base64 to conserve space. Is it a big deal if I remove the equal sign at the end? Would this significantly decrease entropy? What can I do to ensure the length of the resulting …

Total answers: 7

Computing an md5 hash of a data structure

Computing an md5 hash of a data structure Question: I want to compute an md5 hash not of a string, but of an entire data structure. I understand the mechanics of a way to do this (dispatch on the type of the value, canonicalize dictionary key order and other randomness, recurse into sub-values, etc). But …

Total answers: 7

How to get MD5 sum of a string using python?

How to get MD5 sum of a string using python? Question: In the Flickr API docs, you need to find the MD5 sum of a string to generate the [api_sig] value. How does one go about generating an MD5 sum from a string? Flickr’s example: string: 000005fab4534d05api_key9a0554259914a86fb9e7eb014e4e5d52permswrite MD5 sum: a02506b31c1cd46c2e0b6380fb94eb3d Asked By: super9 || Source …

Total answers: 10