Smaz algorithm for ruby