Cast str and encode checksums for python 3