Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'builtin': 0.07; 'base64': 0.09; 'to:addr:comp.lang.python': 0.09; 'variants': 0.09; 'cc:addr:python-list': 0.10; '4-5': 0.16; 'hashes': 0.16; 'md5': 0.16; 'openssl': 0.16; 'subject:Generate': 0.16; 'subject:URL': 0.16; 'wrote:': 0.17; 'wednesday,': 0.22; "python's": 0.23; 'cc:2**1': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'cc:addr:gmail.com': 0.27; 'gil': 0.29; 'hash': 0.29; 'code': 0.31; 'could': 0.32; 'received:google.com': 0.34; 'christian': 0.34; 'richard': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'release': 0.39; 'takes': 0.39; 'times': 0.63; 'box.': 0.65; 'power': 0.74; 'cpu,': 0.84 Newsgroups: comp.lang.python Date: Tue, 13 Nov 2012 17:18:00 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=115.64.101.92; posting-account=2IMPhgoAAADBVBX9EhnSwQd79l-9tJ7H References: <0692e6a2-343c-4eb0-be57-fe5c815efb99@googlegroups.com> <133e0be5-63af-4f72-9d0a-c59b04aa4ce4@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 115.64.101.92 MIME-Version: 1.0 Subject: Re: Generate unique ID for URL From: Richard To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Cc: "python-list@python.org" , Richard Baron Penman X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352855890 news.xs4all.nl 6846 [2001:888:2000:d::a6]:48821 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33285 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.