The present invention relates to a method for transforming a feature vector comprising a first and a second feature represented by a first and a second feature value, respectively, into a feature code using an encoder, said feature code usable in an algorithm and having a predetermined number of bits, said method comprising the steps of determining for each of the first and the second features the performance as a function of the length of the feature code, and using the dependency between the performance and the feature code length for each of the individual features derived in the step of determining to find feature code lengths for the first and the second features in such a way that the sum of the bit length of the first and the second feature codes has a length equaling said predetermined bit length. An advantage with the present invention is that it solves the problem in the case of template protection systems which only accept binary templates and where the resulting classification quality of the biometric system to a very large extend depends on the quality of the binary strings. Another advantage with the present invention is that it also solves the problem of matching time in an identification setting because binary strings can easily be compared. The present invention also relates to a similar arrangement for transforming a feature vector into a feature code. http://worldwide.espacenet.com/publicationDetails/biblio?DB=EPODOC&II=6&ND=3&adjacent=true&locale=nl_NL&FT=D&date=20100519&CC=EP&NR=2186040A1&KC=A1 Source.