We describe an algorithm for the zero suppression and data compression for the Silicon Drift Detectors (SDD) in the ALICE experiment. The algorithm operates on 10-bit linear data streams from the SDDs by applying a 10 bit to 8-bit non-linear compression followed by a data reduction based on a two-threshold discrimination and a two-dimensional analysis along both the drift time and the anodes. The proposed scheme allows for a better understanding of the neighborhoods of the SDD signal clusters, thus improving their reconstructability, and also provides a statistical monitoring of the background characteristics for each SDD anode. The entire algorithm is purely combinatorial and thus can be executed in pipeline, without additional clock cycles, during the SDD readout. The hardware coding together with the methods for the expansion to the original 10-bit values in the offline analysis and for the background monitoring are presented.