I would like to apply a hash code solution on my webpage which is more compact than MD5 and SHA-1, because I want to use them as keys in a JSON hash table.
Or equivalently: how can I convert a hexadecimal MD5 hash to a higher base number system? The higher the better, till the words can be used as keys in a JSON hash. For example instead of:
"684591beaa2c8e2438be48524f555141" hexadecimal MD5 hash I would prefer "668e15r60463kya64xq7umloh" which is a base 36 number and the values are equal.
I made the calculation in Ruby:
Because it handles the big decimal value of the hexadecimal MD5 hash (138600936100279876740703998180777611585)
I've been looking for a method to create a bat file to generate the MD5 checksum of a file.
fciv and a few others, but they all generate a file with additional info such as path and file name etc. I just need the MD5, nothing else.
Anyone point me in the right direction?
This command line
fciv new.xml -md5 -r -xml new.xml.md5
creates a file with the following contents:
<?xml version="1.0" encoding="utf-8"?><FCIV> <FILE_ENTRY><name>new.xml</name><MD5>OuX4jSQyl91+M1fUQZeGtw==</MD5></FILE_ENTRY></FCIV>
I just need the MD5 checksum.
As to one file (not a dir), the results of "md5sum filename" and "tar c filename | md5sum" are different, what's the reason? I know the second command is aim to a dir, but it still works for a file.
Worst case, I have 180 million values in a cache(15 minute window before they go stale) and an MD5 has 2^128 values. What is my probability of a collision? or better yet, is there a web page somewhere to answer that question or a rough estimate thereof? That would rock so I know my chances.
I'm trying to create a python program that would read words from a dictionary, create a md5 hash and compare it to a given hash.
Everything works fine when I try to compare two hashes of words that haven't been read from a file:
if hashlib.md5(b"string").hexdigest() == "b45cffe084dd3d20d928bee85e7b0f21": print("Equal!")
But when I read the words line by line from a file, the hash of the word is different. The code looks like this:
f = open('short.txt', 'r')stringHash = 'b45cffe084dd3d20d928bee85e7b0f21'for line in f: if stringHash == hashlib.md5(line.encode('utf_8')).hexdigest(): print("Found it! Password: %s" % line)
Thanks for any help and explanation.