class to convert raw digits to sdigits