Account for equal rankings when generating a ballot key.
Default cache directory can be /tmp.