To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 429
428  |  430
Subject: 
OID generation (was: Re: wishing upon a star)
Newsgroups: 
lugnet.db.brictionary, lugnet.off-topic.geek
Date: 
Thu, 26 Aug 1999 06:41:47 GMT
Viewed: 
20 times
  
In lugnet.db.brictionary, Larry Pieniazek <lar@voyager.net> writes:
[...]
Best is to assign a unique, program derived key to each person. Then
NEVER EVER tell anyone outside the program what it is. It's plumbing and
it is best left invisible.  [...]

Lar,

I've been experimenting with a method for OID construction which takes a
pseudorandom 32-bit integer, converts it to a 40-bit integer by adding 8
bits of CRC, then converts that an to 8-byte base-32 ASCII representation
using the 32 digits 0-9, A-H, J-N, P-R, and T-Y (that's the 36 digits 0-9
plus A-Z, minus the four letters I, O, S, and Z, which are susceptible to
confusion with 1, 0, 5, and 2, respectively, by humans).

Although only the DBMS sees and understands the OIDs, throwing in the CRC is
still beneficial because human inspection of low-level data structures is
occasionally needed -- even if it's only to verify emperically that the DMBS
is functioning properly in some given questionable case -- and a good CRC
makes certain types of human error (accidentally transposing or altering
digits) much more possible to detect.

Using random numbers instead of meaningful numbers results in OIDs which are
distributed uniformly and randomly over the OID domain, which in turn means,
among other things, that the OIDs themselves make excellent default hash
keys in the absense of an overriding application- or class-specific hash
function.

In theory, whether the OID is actually stored at the lowest level as 8 bytes
(the most expanded form) or as 5 bytes (the medium form) or as 4 bytes (the
most compact form) is an implementation detail, but I just use the full
8-byte version everywhere for maximum flexibility; it's a simple enough
transformation to convert back to the raw 32-bit form on-the-fly wherever
needed.

The actual OIDs then come out looking exactly like this (an actual sample of
10 sequentially generated OIDs):

   :
   RFU2VQBB
   CQY9AYY6
   HAMJELG7
   C50V85PA
   K7A6R2EF
   VGQ36YWR
   F2N6BMP4
   EWU1YDFT
   KY51MET9
   L8PX6HJP
   :

In your experience as a sysarch, is this about as good as it gets? or are
there more robust methods for generating OIDs?  (Let's assume WoLOG that
2^32 is a sufficient maximum number of OIDs; it could just as well be 48 or
64 bits.)

--Todd



Message has 2 Replies:
  Re: OID generation (was: Re: wishing upon a star)
 
(...) Quick answer: yes. Long answer: Almost certainly. There are some tradeoffs that you've made. A big one is around the human readability of the key. Ask yourself, how often do humans inspect these, and how fast can you convert back to 40bit (...) (25 years ago, 26-Aug-99, to lugnet.db.brictionary, lugnet.off-topic.geek)
  Re: OID generation (was: Re: wishing upon a star)
 
(...) Just to save others the effort -- "wolog" occurs 3 times on Hotbot and 28 times in Alta Vista. The best interpretation in this context appears to be an abbreviation for "without loss of generality". - Robert Munafo (URL) LEGO: TC+++(8480) SW++ (...) (25 years ago, 26-Aug-99, to lugnet.off-topic.geek)

Message is in Reply To:
  Re: wishing upon a star
 
(...) Whoops. Talking in shorthand tripped me up. In system-architect-speak "business" logic is the actual desired work effort of the program (contrasted with non business logic which is the infrastructure or other code that you have to do in order (...) (25 years ago, 26-Aug-99, to lugnet.db.brictionary, lugnet.off-topic.geek)

22 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR