Converting a string to a number by using INT (no hash method)

D'Arcy J.M. Cain darcy at
Tue Jan 22 18:04:45 CET 2013

On Tue, 22 Jan 2013 16:27:32 +0000
"Leonard, Arah" <Arah.Leonard at> wrote:
> > I just need a way to CONVERT a string(absolute path) to a 4-digit
> > unique number with INT!!! That's all i want!! But i cannot make it
> > work :(

Why bother?  Just wish for a zillion dollars and then you never have to
program again.  At least that would be theoretically possible.

> *might* be able to convert a string that long into some kind of
> 4-digit integer checksum, but you would *never* be able to convert
> that back into a file path.  Nor would it be guaranteed to be unique.

In fact, if you have 10,001 files it is absolutely guaranteed to have at
least one duplicate entry.

D'Arcy J.M. Cain <darcy at>         |  Democracy is three wolves                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
IM: darcy at Vex.Net

More information about the Python-list mailing list