defined hamming distance mask class basics