Algorithm
Dan Coutu
coutu at snowy-owl.com
Thu Mar 29 12:41:28 PDT 2007
Hmm, well you could convert the numbers to another base system, such as
base 36 in order to end up with fewer characters as long as alpha
characters are allowed.
The general idea of base 36 is this mapping:
1 is 1
9 is 9
10 is a
11 is b
20 is j
30 is t
36 is z
37 is 11
38 is 12
50 is 1a
etc.
But at the beginning of your request you did use the phrase 'a unique
number'. So maybe this is useless.
Dan
Don Coleman wrote:
> List:
>
> I am faced with assigning a unique # which must correlate to a numeric
> string that is comprised of an 8 digit Rx # and a 7-10 decimal quantity.
> Currently, each prescription label has a barcode which is an 8 digit Rx# and
> a 5 digit quantity. Due to a required software upgrade on their Clinical
> Prescription Software application the quantity must be changed from an
> integer value to a decimal, possibly with up to 4 digits to the right of the
> decimal point.
>
> Two solutions come to mind:
>
> "Compress" the 15-18 digit # into a 8-10 digit # via application of an
> algorithm and "uncompress" it as needed. I'm guessing this would involve
> use of letters in addition to strictly #'s. Unsure if this type of
> intelligence is available. I checked the phone book but could not locate
> the local algorithm store. Google lists many sites, beginning with
> Wikipedia examples, but I've never been a fan of this source.
>
> Assign a unique (sequential) # within my fP application and distribute this
> # plus the original # as necessary. Other alien applications would also
> need to access and cross-reference this number so I would explore posting to
> an SQL file.
>
> Thoughts or suggestions?
>
> Don Coleman
> Donald G. Coleman, Consultant
> 402 Andrew Circle
> Indiana, PA 15701
> dcoleman at dgcreact.com
> (724) 349-6302
>
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
>
More information about the Filepro-list
mailing list