Actually what you are describing is COMPRESSION rather than a CRC. YES there are compression schemes. For instance, Huffman Coding.... It's really simple. Do a Statistical Analysis of your data, (As measured in operation) Take the highest statistical values, and using a variable length storage unit, store them using the smallest storage element. EG: The highest probability event is coded 0 The next most highest probability event is coded 10, the next most (Third probability event is coded 110... etc. You will find that you can only code stuff about 5 levels deep this way before it begins to expand the cost of your code. (assuming a byte oriented coding scheme that you are trying to compress). Then, simply use the last coding level, + the actual data, from then on. It works best when there is a Wide variation in statistical probability, i.E. the first element is 90% of all elements measured.... etc. Its also a lot of bit banging. Alternately, utilizing a coding/compression scheme based on the fact that the range of values is less than the permutations of the data storage element, ie 8 bits = 256, (often called "Packing") can reduce storage to the point where you recover the difference between the packed size of the data, and the unpacked size. I have heard of really far out compression schemes, but, found that many of them were ignorant of one especial rule of storage, (you can't reduce a data element beyond the number of bits required to cover the number of permutations that will be stored, unless you LOSE DATA, which afterwards you won't necessarily be able to recover). You can take advantage of the fact that you do not use the whole set of permutations, by using a dictionary based form of compression, but again, it is based on the concept that you do not need the same amount of data to store, the lesser permutations, than you would if you used all the possible values. If you have a "Dictionary" of more used terms, you can "Pack" the data, (Possibly using Huffman coding) into a smaller space, but need to include a reference to which "Dictionary" you are using, the more dictionaries you need, the less effective your compression becomes. If you have a limited number of options, it is sometimes possible to "Approximate" the correct value, by using "Hashing" type algorythms, but be careful, it's only an approximation, you can have "Hits" where two values have the same "Hashing" value. In this case only the first value will come out when you search, unless you do multiple results from your search. A CRC is really only a specific type of "Hashing" formula, in this manner of compression. When using a CRC, it is really only a one-way algorythm, because all it is meant to do, is allow you to compare two values that are similar to see if they are the same. It makes its own assumptions, that you wont be comparing things that are so different as to wrap around, and have the same CRC value. True Compression is two way. Don't be fooled by Imitations... ;) GRAEME SMITH email: grysmith@freenet.edmonton.ab.ca YMCA Edmonton Address has changed with little warning! (I moved across the hall! :) ) Email will remain constant... at least for now. On Fri, 16 Apr 1999, Jaume Aragay Badia wrote: > Hi again! > > I have a question about IR remotes. For my project at universi ty I'm > preparing a house control for blind people or people with cerebral palsy. > One of the items is a kind of universal remote control that learns from the > existing ones the more used codes. Now to the point... > > How would you store this IR codes information? Because in Myke Predko' s > book he uses a sort of CRC to store the information recieved and just > identify it but, is there any way to *undo* this CRC to get the original > code again to send it? > > In other words, is there any way to store the codes recieved in a smal l > size format and to put them back to the original format later when they are > to be sent? > > TIA. > > > Jaume. > > ---------------------- > Jaume Aragay Badia > aragay@email.com > ---------------------- >