Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'string.': 0.04; '22,': 0.09; 'received:mail-vb0-f46.google.com': 0.09; 'subject:method': 0.09; 'do,': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'type:': 0.16; 'string': 0.17; 'wrote:': 0.17; 'integer': 0.17; 'subject:page': 0.17; 'jan': 0.18; 'received:209.85.212.46': 0.18; 'absolute': 0.23; 'header:In- Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'probably': 0.29; 'subject: .': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'path': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'chance': 0.61; 'relations': 0.62; 'pin': 0.65; '2013': 0.84; 'collision.': 0.84; 'subject:Using': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=6DBRU7oHvr8t6YGmAGIxNKwFUnobvfkhNc46KPA51gg=; b=FzTh/2sAedRxX3biv7TKoRzjrFL9pDjDvf7+2wKVTCVI3gr0PbPbyOJ5L4Qzcw180f WDT4hDJZ5SAze58n+rWPGl5Q9Dhw26zK26CN/QTA2MqCPBn6vF0LXNl0taaggj7ctHFK Mjv2vV/3m2XYDVHV0Vdli/BGBzVpXRIozICMwx+R16jrUOxKx3Z7tloyV66JTLAeA6tb WyYcKV1FNwd294Q7RmEefJXOIng1v/MZLfJO5yL7X58NamRTAp+adgDomg8rd8Qpkddj ain0x3DzipVSdQ/WIyv1v3N+ZLGlSCYnyWqg0E7zzr/7eM/LtkWR0JiEpWN6vMwW2pHT iiFQ== MIME-Version: 1.0 X-Received: by 10.52.176.202 with SMTP id ck10mr20219251vdc.42.1358859547555; Tue, 22 Jan 2013 04:59:07 -0800 (PST) In-Reply-To: <11312870-e6cc-4a2f-8fc5-a753aef06200@googlegroups.com> References: <50fe787e$0$30003$c3e8da3$5496439d@news.astraweb.com> <11312870-e6cc-4a2f-8fc5-a753aef06200@googlegroups.com> Date: Tue, 22 Jan 2013 23:59:07 +1100 Subject: Re: Using filepath method to identify an .html page From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358859550 news.xs4all.nl 6851 [2001:888:2000:d::a6]:52129 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37269 On Tue, Jan 22, 2013 at 11:47 PM, Ferrous Cranus wrote: > What i want to do, is to associate a number to an html page's absolute path for to be able to use that number for my database relations instead of the BIG absolute path string. > > so to get an integer out of a string i would just have to type: > > pin = int( htmlpage ) > > But would that be unique? The absolute path probably isn't that big. Just use it. Any form of hashing will give you a chance of a collision. ChrisA