Common data encoding algorithms