A computer-implemented method of finding a position (X,Y) of a mask B observed in a two-dimensional symbol pattern PW having the property that any mask B with a defined shape and a size of at least m symbol values is unique, the symbol pattern being based on a non-repeating sequence S of symbol values Sk that each corresponds to a fixed linear combination of coefficients C of monomials in xk mod P(x), where P(x) is any polynomial of degree n in field Fq, and the symbol pattern PW being formed by folding said sequence S according to a wrapping scheme W, said method comprising:
- retrieving, from a memory device, information about a relationship between the symbol values in the mask B and the corresponding coefficients C;
- extracting, by using a processor, the symbol values of said mask B at said position (X,Y);
- calculating, by using the processor, the corresponding coefficients CX,Y from BX,Y by means of said relationship, where BX,Y are the extracted symbol values of B at said position (X,Y);
- determining, by using the processor, a location k in the sequence S where the coefficients C equal CX,Y;
- and
- calculating, by using the processor, said position (X,Y) in the symbol pattern PW based on the location k and the wrapping scheme W.