Ruby implementation of Canonical Gameplay Hash coding.