A characteristic function representing data, particularly relating to the recording of a plurality of measurements taken by one or more sensors, is received (410), the characteristic function being particularly a Boolean function. A first hash code is calculated from the characteristic function (414). The characteristic function is transformed to an arithmetic function (414). A second hash code is calculated from the arithmetic function (418). If the first hash code equals the second hash code, the data is designated as valid otherwise, the data is designated as invalid. The invention is particularly applied to environmental or medical sensors.