Encoding / decoding strings

Jon Clements joncle at googlemail.com
Fri Jan 5 07:29:14 EST 2007


oliver at obeattie.com wrote:

> Hey Everyone,
>
> Was just wondering if anyone here could help me. I want to encode (and
> subsequently decode) email addresses to use in URLs. I believe that
> this can be done using MD5.
>
> I can find documentation for encoding the strings, but not decoding
> them. What should I do to encode =and= decode strings with MD5?
>
> Many Thanks in Advance,
> Oliver Beattie

Depends what you mean by "encode email addresses to use in URLs". MD5
is a cryptographic one-way hash function; it creates a 'finger print'
of the input data: given this, it's impossible to reproduce the
original input.

Is this what you're looking for?

>>> import urllib
>>> urllib.quote('some.person at somedomain.com')
'some.persons%40somedomain.com'

hth
Jon.




More information about the Python-list mailing list