Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.04; 'binary': 0.05; '-0500': 0.07; 'chunk': 0.07; 'subject:How': 0.09; 'subject:number': 0.09; 'to:addr:python.list': 0.09; 'to:addr:tim.thechases.com': 0.09; 'cc:addr:python-list': 0.10; ':-)': 0.13; 'encoding': 0.15; 'sat,': 0.15; 'value.': 0.15; '-tkc': 0.16; '[*]': 0.16; 'lowercase': 0.16; 'number?': 0.16; 'omitting': 0.16; 'roy': 0.16; 'tim,': 0.16; 'tried:': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'skip:- 40': 0.21; 'thanks.': 0.21; '3.2': 0.22; 'back.': 0.22; 'number)': 0.22; 'cc:2**0': 0.23; "haven't": 0.23; 'to:2**1': 0.23; 'seems': 0.23; 'idea': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; '(which': 0.26; 'common': 0.26; '(see': 0.27; 'skip:( 20': 0.28; 'concern': 0.29; 'date:': 0.29; 'url:mailman': 0.29; 'character': 0.29; 'url:python': 0.32; 'to:no real name:2**1': 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'from:addr:live.com': 0.33; 'zero': 0.33; 'point.': 0.33; 'nov': 0.35; 'subject:?': 0.35; 'subject:': 0.36; 'but': 0.36; 'url:org': 0.36; 'characters': 0.36; 'url:library': 0.36; 'email addr:python.org': 0.36; 'too': 0.36; 'one,': 0.37; 'does': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'easier': 0.38; 'things': 0.38; 'url:docs': 0.38; 'several': 0.39; 'gives': 0.39; 'end': 0.40; 'url:mail': 0.40; 'easy': 0.60; 'back': 0.62; 'email name:python-list': 0.62; 'letters': 0.62; 'capable': 0.63; 'information': 0.63; 'making': 0.64; 'account': 0.67; 'capital': 0.68; 'smith': 0.71; 'subject:account': 0.74; 'email addr:panix.com': 0.84; 'eye,': 0.84; 'cars': 0.91; 'mistake': 0.91; 'mistakes': 0.95; 'charset:windows-1251': 0.97 X-Originating-IP: [213.130.16.2] From: Andriy Kornatskyy To: , Subject: RE: How to generate account number? Date: Sat, 3 Nov 2012 19:23:36 +0300 Importance: Normal In-Reply-To: <50953982.7090305@tim.thechases.com> References: <1gsdm9-r2c.ln1@crazy-horse.bildanet.com> , , <50953982.7090305@tim.thechases.com> Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 03 Nov 2012 16:23:36.0717 (UTC) FILETIME=[93811BD0:01CDB9DF] 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: , Newsgroups: comp.lang.python Message-ID: Lines: 49 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351959884 news.xs4all.nl 6914 [2001:888:2000:d::a6]:53323 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32703 Tim=2C Good point. b32decode seems to be capable to understand such common mistake= s (see map01 argument to b32decode)=2C I haven't tried: http://docs.python.org/2/library/base64.html Thanks. Andriy ---------------------------------------- > Date: Sat=2C 3 Nov 2012 10:34:26 -0500 > From: python.list@tim.thechases.com > To: roy@panix.com > Subject: Re: How to generate account number? > CC: python-list@python.org > > On 11/03/12 08:22=2C Roy Smith wrote: > > Even better might be base-32 encoding the value. Strings of > > digits have an information density of about 3.2 bits/char. > > Base-32 is just about as readable=2C but gives you 5 bits/char=2C so > > you end up with a few less characters (which you still want to > > chunk into 3 or 4 character groups). > > For things that will be read off a screen/paper=2C I recommend > omitting several letters that are easy to mistake visually: i/I/l/1 > and O/0 in particular. The VIN (vehicle identification number) on > all US cars avoids these characters[*]=2C making it easier to read > them back without concern for "is that a zero or an oh=3B and is that > an ell=2C a one=2C a lowercase eye=2C or a capital eye?" As an encoding > advantage=2C > > >>> print len(''.join(c for c in (string.ascii_uppercase + > string.digits) if c not in "O0iIl1")) > 32 > > the number 32 is pretty handy when dealing with binary :-) > > -tkc > > > [*] > The VIN avoids "Q" too and does use the digits 0/1=2C but the idea > holds. Make it easy to ready back. > -- > http://mail.python.org/mailman/listinfo/python-list =