Arithmetic coding in Python

We shrink Dostoevsky&rsquo;s &ldquo;Crime and Punishment&rdquo; to its limit using arithmetic coding. This article showcases my Python implementation of the algorithm.