A method of compressing an input data word x into a first output data word form a set of b possible output data words, b being of the form pk where p is a prime number and k is a positive integer, said method comprising the steps of:separating said input data word x into n portions x1 through xn ; selecting an element y from a finite field of b elements; and generating said first output data word