An identification encoding device adapted for coding an element list, S, of identifiers into an identification in the distribution of a data set from a server to a network, the data set comprising a plurality of data blocks, the network comprising a plurality of terminal devices (16a-16f, 50-55), each terminal device (16a-16f, 50-55) having a cache memory (20a-20f, 60-65) for caching data blocks of the data set, a cache state describing a state of a set of data blocks in a cache memory (20a-20f, 60-65), wherein - either an identifier comprises a file identifier for uniquely identifying a data block of the data set, the identification describing the cache state of one of the plurality of terminal devices (16a-16f, 50-55), - or an identifier comprises a user identifier for uniquely identifying a terminal device (16a-16f, 50-55) or a group of terminal devices in the network, the identification describing a terminal device (16a-16f, 50-55) or a group of terminal devices having a particular cache state, wherein an identifier represents an element of an element set, the element set representing the set of all identifiers in the network, the identification encoding device being designed for unambiguously assigning the identifier to the element list, S, wherein the element list, S, comprises a plurality of elements selected from the element set, the element set having a predetermined total number, N, of elements, each element being uniquely represented by an integer ∈ {0,..., N - 1}, the identification encoding device being configured to perform the following steps: a) counting the number, k, of the elements of the element list, S, and storing the number, k, in a cardinality counter; b) storing the number 0 as a value, b, in a limit counter; c) storing the number 0 as a value, c, in a cache memory; d) storing the smallest element of the element list, S, as a value, m, in an element cache memory; e) removing the smallest element from the element list, S; f) comparing the value, m, of the element cache memory and the value, b, of the limit counter as well as proceeding with step g) if the values are identical, otherwise proceeding with step k); g) decreasing the value, k, of the cardinality counter by 1; h) comparing the value, k, of the cardinality counter with 0 and proceeding with step n) if the value of k is equal to 0, otherwise proceeding with step i); i) increasing the value, b, of the limit counter by 1; j) determining whether the value, b, of the limit counter corresponds to the total number, N, of elements, if so, proceeding with step n) otherwise proceeding with step d), k) calculating the binomial coefficient N − b − 1 k − 1 and adding the result to the value, c, of the cache memory; l) increasing the value, b, of the limit counter by 1; m) comparing the value, b, of the limit counter with the total number, N, of elements and proceeding with step n) if the values are identical, otherwise proceeding with step f); n) transferring the content, c, of the cache memory as an identification. - either an identifier comprises a file identifier for uniquely identifying a data block of the data set, the identification describing the cache state of one of the plurality of terminal devices (16a-16f, 50-55), - or an identifier comprises a user identifier for uniquely identifying a terminal device (16a-16f, 50-55) or a group of terminal devices in the network, the identification describing a terminal device (16a-16f, 50-55) or a group of terminal devices having a particular cache state, a) counting the number, k, of the elements of the element list, S, and storing the number, k, in a cardinality counter; b) storing the number 0 as a value, b, in a limit counter; c) storing the number 0 as a value, c, in a cache memory; d) storing the smallest element of the element list, S, as a value, m, in an element cache memory; e) removing the smallest element from the element list, S; f) comparing the value, m, of the element cache memory and the value, b, of the limit counter as well as proceeding with step g) if the values are identical, otherwise proceeding with step k); g) decreasing the value, k, of the cardinality counter by 1; h) comparing the value, k, of the cardinality counter with 0 and proceeding with step n) if the value of k is equal to 0, otherwise proceeding with step i); i) increasing the value, b, of the limit counter by 1; j) determining whether the value, b, of the limit counter corresponds to the total number, N, of elements, if so, proceeding with step n) otherwise proceeding with step d), k) calculating the binomial coefficient N − b − 1 k − 1 and adding the result to the value, c, of the cache memory; l) increasing the value, b, of the limit counter by 1; m) comparing the value, b, of the limit counter with the total number, N, of elements and proceeding with step n) if the values are identical, otherwise proceeding with step f); n) transferring the content, c, of the cache memory as an identification.