Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(at': 0.03; 'retrieval': 0.05; 'say,': 0.05; 'bytes)': 0.09; 'sub': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'suggest': 0.11; 'disk.': 0.16; 'dwarfed': 0.16; 'md5': 0.16; 'storing': 0.16; 'structure.': 0.16; 'subject:Generate': 0.16; 'subject:URL': 0.16; 'url.': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'wednesday,': 0.22; 'cc:2**0': 0.23; 'example': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'disk': 0.27; 'chris': 0.28; 'app.': 0.29; 'arithmetic': 0.29; 'hash': 0.29; 'probably': 0.29; "i'm": 0.29; 'folder': 0.30; 'figure': 0.30; 'point': 0.31; 'could': 0.32; 'limitations': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'nov': 0.35; 'richard': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'store': 0.38; 'files': 0.38; 'some': 0.38; 'gone': 0.64; '100': 0.78; 'viewed': 0.78; 'locally': 0.84; 'average': 0.93 Newsgroups: comp.lang.python Date: Tue, 13 Nov 2012 20:14:02 -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> <1ce88f36-bfc7-4a55-89f8-70d1645d27ad@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 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352866451 news.xs4all.nl 6859 [2001:888:2000:d::a6]:37375 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33298 yeah good point - I have gone with md5 for now. On Wednesday, November 14, 2012 3:06:18 PM UTC+11, Chris Angelico wrote: > On Wed, Nov 14, 2012 at 2:25 PM, Richard wrote: > > > So the use case - I'm storing webpages on disk and want a quick retrieval system based on URL. > > > I can't store the files in a single directory because of OS limitations so have been using a sub folder structure. > > > For example to store data at URL "abc": a/b/c/index.html > > > This data is also viewed locally through a web app. > > > > > > If you can suggest a better approach I would welcome it. > > > > The cost of a crypto hash on the URL will be completely dwarfed by the > > cost of storing/retrieving on disk. You could probably do some > > arithmetic and figure out exactly how many URLs (at an average length > > of, say, 100 bytes) you can hash in the time of one disk seek. > > > > ChrisA