GENERAL› -------››The VCR plus coding uses several hash›codings, some in base ten, some in›binary.››One thing frequently used is›polynomials/power series over a›ring.››If R is a finite commutative RING›with identity, let R[x] be the set of›polynomials with coefficients in R,›and R[[x]] the ring of power series›(polynomials of "infinite" degree if›necessary).››1/(1-x) is NOT in R[x], but IS in›R[[x]] being nothing but the power›series 1+x+x^2+x^3+....››Given a sequence of digits from R›(say a,b,c,d) we can form the›polynomial:››a*x^3+b*x^2+c*x+d = P(x) or››d*x^3+c*x^2+b*x+a = Q(x)››(NOTE: Q(x)=x^3*P(1/x))››In some of the encodings it is easier›to work with the second form (HASH3)›than the first (HASH1) (to work with›the first form in HASH3 we would have›to look at the ring made up of›polynomials plus power series in›INVERSE powers of x!... it is easier›to reverse the order and work with›power series).››Polynomial encodings are used›frequently, for if we take a series›of bits and treat it as a polynomial›in Z_2 (Z_2 being the ring of 0/1›added/multiplied modulo TWO), and let›p(x) be some polynomial (fixed) then›given a string of bits, q(x), its›image in Z_2[x]/(p) (the quotient›ring) (which involves finding the›remainder of dividing q(x) by p(x),›the result is a polynomial of degree›less than that of p's degree and›hence can be specified by deg(p)›bits). This is a check sum (most›check sums are determined by›polynomials) (to find the result,›simply divide by p and write the›remainder, for example, if p=1+x over›Z_2[x], and q=q0+q1*x+q2*x^2+q3*x^3,›then dividing in Z_2, we get:››q/p=q3*x^2+(q3+q2)*x+(q3+q2+q1) with›remainder q3+q2+q1+q0. In this case,›deg(p) is one, and the remainder is›of degree 0, specified by one bit.›This remainder is nothing but the›parity check sum.››Multiplying a power series by an›invertible power series (allowing›inversion of the operation) is one›way of encoding a string of›coefficients from R. The VCR+ routine›does this for the digits in base ten›at two points.››The following material is technical›and gives a technical discussion of›the algorithms used in the VCR+.››An advantage is that it enables one›to find (using the description) the›inverse of one algorithm from the›other.››The routines have been taken from the›VCRPLUS coding/decoding file on GEnie›which incorporated the routines in›C-source code. HOWEVER, the›programmer found the decoding›routines and did not note that (by›writing them as polynomial routines)›the HASH3 coding could be easily›inverted (so that his encoding›routine simply searches over and over›to find the correct values; my›routines simply invert it!).››Also, the VCRPLUS programme on GEnie›does not (nor does this) handle any›but those shows which start and end›on hours or half hours of length less›than or equal to five hours and for›channels from one to sixty-four›(also, the year is taken mod 100 and›mod 16, who knows but that certain of›the parameters in other parts of the›code actually depend on the century›and the year outside this limit!?).››This set also contains listed source›code for an encoder/decoder in›TurboBasicXL for the Atari 8 bit›computers. It should be fairly easy›to convert to other basics (one will›need routines to find bits of binary›numbers, but that is a standard›technique. TurboBasicXL has bit by›bit ANDing for two byte integers and›is used in the coding. Also,›TurboBasicXL has PROCedures as well›as Subroutines... they are the›same... instead of EXEC MYPROC where›MYPROC is:››line x: PROC MYPROC› code› ENDPROC››one can replace the ENDPROC with a›return and do a GOSUB x for exactly›the same result).››The full description of the›algorithms from a technical aspect is›included, and this will enable anyone›who can figure out the HASH1 code (it›is mentioned for up to 8 digit›numbers, as encoded in the C-code on›GEnie, but that code is only›guaranteed to work for 6 digit codes!›so the polynomials MAY have to be›modified!) and the values for other›channels and times/durations can›modify the code. NOTE that the code›here for HASH3 only sets up the›powers for a certain power series to›enable a six digit code. One would›have to extend the POW (an array of›coefficients of certain power series)›arrays to handle higher digits.››Finally TurboBasicXL has the›commands:›› A= B DIV C which is TRUNC(B/C)››and A= B MOD C which is›B-C*TRUNC(B/C)››(NOTE, INT(-1.5)=-2!, but›TRUNC(-1.5)=-1 (TRUNC=TRUNCate,›rather than round down)... as we need›positive values, I had to check that›when I did a MOD 10 and had a case›wherein the result MIGHT be negative,›that I added ten to it... so›-1 MOD 10 comes out -1 but should›come out 9 (if we have principal›residues)... note that B-10*INT(B/10)›would have given 9 for the residue›modulo ten).››I think that is all the necessary›discussion (besides the discussion in›the technical documentation) to›enable one to convert the›TurboBasicXL programme to other›basics.›› -----››This set of routines and›documentation is based on the›algorithms in the C-source code on›GEnie, but the documentation and›Basic programme is all by me, and›copyright 1993 by›John McGowan (J.MCGOWAN15 on GEnie)›and is FREEWARE (meaning, do with it›what you will, but do NOT claim›credit for it as all your own work,›but give credit where it is due).›› -----››Hope this helps people out.›› ›Sincerely,›› ›John McGowan› ›J.MCGOWAN15 on GEnie› ›[Watson] of the DioGEnies Club›