473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MD5()

Hello,
I'm using this code to get the MD5 of the numbers 0-9. How can I loop
through the combination of all lowercase letters and 0-9. I read in the
documentation the string operation ascii_lowercase but I'm a bit confused on
how to combine it with integers. Thanks in advance.

for i in xrange(10):
import md5
m=md5.new()
m.update("%i"%i)
print"i=",i,"md5(i)=",m.hexdigest()
Jul 18 '05 #1
1 1439
On Tue, 26 Oct 2004 22:37:47 -0400, ed18hg <ed****@brllsouth.net> wrote:
Hello,
I'm using this code to get the MD5 of the numbers 0-9. How can I loop
through the combination of all lowercase letters and 0-9. I read in the
documentation the string operation ascii_lowercase but I'm a bit confused on
how to combine it with integers. Thanks in advance.
It depends what you mean by "combination of all lowercase letters and 0-9".

http://aspn.activestate.com/ASPN/Coo.../Recipe/190465

shows one way of generating combinations, but what you want depends on
what you are actually trying to do.

for i in xrange(10):
import md5
m=md5.new()
m.update("%i"%i)
print"i=",i,"md5(i)=",m.hexdigest()


If you want all pairs of lowercase letters and 0-9 you could, for example, use:

import string
import md5

def pairs(s):
for c1 in s:
for c2 in s:
yield c1+c2

for i in pairs(string.ascii_lowercase+string.digits):
m = md5.new()
m.update(i)
print "i=",i,"md5(i)=",m.hexdigest()

--
Sam Holden
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: | last post by:
I'm curious how these two functions work together (when crypt() uses a md5 algo). Currently I know they will produce different output; is this due to the salt being used behind-the-scenes in md5()?...
4
by: Christian Meisinger | last post by:
hi. has anyone tryed to check .htpasswd passwords with php? everythink works fine as long as they are encrypted with the default CRYPT mode of apaches htpasswd. crypt($pass, $htpass) ===...
27
by: frizzle | last post by:
Hi there, I've read in a few places that you should *never* store original passwords in a mySQL DB. Now i wonder if you encrypt it (with MD5 ?), how should i create a lost password function,...
1
by: Leandro Lameiro | last post by:
Hi folks Recently I have been discussing with a friend about python ease of use, and it is really good at this. This friend needed to calculate the MD5 hash of some files and was telling me...
3
by: Amir Hadi | last post by:
Hi @ all I am new in programming C under GNU/Linux I want to ask you, is there any md5 solution in C under Linux? If yes, can you give me some pages with informations about md5 in C? I allready...
15
by: Peter Afonin | last post by:
Hello, I'm struggling with the string conversion to MD5 which I've never user before. I have a string that I need to encode which looks approximately like this: ...
3
by: DurumDara | last post by:
Hi ! I need to speedup my MD5/SHA1 calculator app that working on filesystem's files. I use the Python standard modules, but I think that it can be faster if I use C, or other module for it. ...
7
by: nonameisfree | last post by:
I am trying to get StartUp-Manager to write the grub password in encrypted form to menu.lst. Currently it writes the password in plain-text and that is not too clever... This is the function I...
4
by: MS | last post by:
Hi, I'm writing a PHP login script for a web site. I've looked at several examples on the web and some of them use MD5 hashes for the password. They do this in various ways. EG. a) Storing...
2
by: joe shoemaker | last post by:
I would like to convert url into md5 hash. My question is that md5 hash will create collision at 2^64. If you do long(value,16), where value is the md5 hash string, would value returned from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.