Message from discussion
Generate unique ID for URL
Received: by 10.224.219.144 with SMTP id hu16mr9112716qab.1.1352855880973;
Tue, 13 Nov 2012 17:18:00 -0800 (PST)
Received: by 10.52.20.51 with SMTP id k19mr12363vde.4.1352855880943; Tue, 13
Nov 2012 17:18:00 -0800 (PST)
Path: gf5ni56274882qab.0!nntp.google.com!u2no679179qal.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Tue, 13 Nov 2012 17:18:00 -0800 (PST)
In-Reply-To: <mailman.3657.1352854794.27098.python-list@python.org>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=115.64.101.92;
posting-account=2IMPhgoAAADBVBX9EhnSwQd79l-9tJ7H
NNTP-Posting-Host: 115.64.101.92
References: <0692e6a2-343c-4eb0-be57-fe5c815efb99@googlegroups.com>
<k7ulda$geh$1@reader1.panix.com> <133e0be5-63af-4f72-9d0a-c59b04aa4ce4@googlegroups.com>
<CALvWhxsMx34QdNNi0dpMCZ_VL055gSY8v_kNvfsEW7CSMK-N_w@mail.gmail.com>
<CAOV1wRWNg1Wj954CimDYT0HV-XVs-1snaWFi--bQqCgZZD6UdQ@mail.gmail.com> <mailman.3657.1352854794.27098.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <90679521-52f9-409c-b6ad-5970863c0cff@googlegroups.com>
Subject: Re: Generate unique ID for URL
From: Richard <richar...@gmail.com>
Cc: Richard Baron Penman <richar...@gmail.com>, "python-l...@python.org" <python-l...@python.org>
Injection-Date: Wed, 14 Nov 2012 01:18:00 +0000
Content-Type: text/plain; charset=ISO-8859-1
I found md5 / sha 4-5 times slower than hash. And base64 a lot slower.
No database or else I would just use their ID.
On Wednesday, November 14, 2012 11:59:55 AM UTC+11, Christian Heimes wrote:
> Am 14.11.2012 01:41, schrieb Richard Baron Penman:
>
> > I found the MD5 and SHA hashes slow to calculate.
>
> > The builtin hash is fast but I was concerned about collisions. What
>
> > rate of collisions could I expect?
>
>
>
> Seriously? It takes about 1-5msec to sha1() one MB of data on a modern
>
> CPU, 1.5 on my box. The openssl variants of Python's hash code release
>
> the GIL so you use the power of all cores.