Newsgroups: sci.crypt
Path: msuinfo!galaxy.cps.msu.edu!gurney
From: gurney@galaxy.cps.msu.edu (Eddy J. Gurney)
Subject: Some info on what is encoded and how for VCR+ codes 
Message-ID: <1992Jan7.155919.13145@msuinfo.cl.msu.edu>
Originator: gurney@galaxy.cps.msu.edu
Sender: news@msuinfo.cl.msu.edu
Organization: Dept. of Computer Engineering, Michigan State University
Date: Tue, 7 Jan 92 15:59:19 GMT

While I attempt to find the source which works for VCR+ codes of four
digits or less, here's some introductory info that I got in reply to
a previous query on sci.electronics back in August:

/* Begin included message */
From: shirriff@sprite.berkeley.edu (Ken Shirriff)

In article <1991Aug23.154643.20995@msuinfo.cl.msu.edu> gurney@galaxy.cps.msu.edu (Eddy J. Gurney) writes:
>This is my question: DOES ANYONE KNOW THE ALGORITHM FOR CREATING THE CODES?
>Does anyone know for sure WHAT is encoded in the number?

A quick summary of the codes:
They encode the start time, channel, duration, and day of the month.
Start time and duration are in 5 minute intervals.  The coding changes
slightly from month to month and from year to year.  The "stranger" the
show, the longer the code.  E.g. recording a half hour show at 9 might
be 3 or 4 digits, while a 2:45 minute show on channel 93 at 4:20 am might
be 8 digits.

The codes are encoded by using a number of 32 entry lookup tables
containing eight start times and durations, and the bottom two channel bits.
The bits of the table number are then interleaved with bits from
the high bits of the channel to form the top digits.  The last 3
digits combine the position of the table and the day of the month.
(Note that 32 positions x 31 days = 992, which fits nicely in 3 digits.)
The resulting number then goes through a convolution with a fixed number
to give the final code.  There are some weird functions of the day,
month, and year that perturb these intermediate numbers for added
confusion.  Then the codes undergo another operation so that short codes
go to common things and long codes go to uncommon things.  (This is the
only connection with Huffman codes, on a very abstract level.)

As a final step, there is a mapping from encoded channel to the channel
that is actually used.  This mapping is different in different broadcast
areas, and is available in the TV Guide.  This is how the VCR+ knows what
channel HBO is on.  For instance, in Northern California,
VCR+ channel 2 -> physical channel 2, 4 -> 4, 5 -> 5, 7 -> 7, etc.,
17 -> 46, 34 -> ESPN, 48 -> MTV and like that.

/* End included message */

So at least there's SOMETHING to go on... I'll look for the program later
tonight.

Regards,
Eddy

-- 
         Eddy J. Gurney  N8FPW       THE ECCENTRICITY GROUP           EEEEGGGG
gurney@cps.msu.edu     gurney@egr.msu.edu     17158EJG@MSU.BITNET     EEE G GG
   (Preferred)          (If cps bounces)      (If you HAVE to :-)     EEEEGGGG
--
   "Failures are divided into two classes-- those who thought and never did,
         and those who did and never thought."     John Charles Salak
