def hash_from_code(msg):
        try:
            return hashlib.md5(msg).hexdigest()
        except TypeError:
            assert isinstance(msg, numpy.ndarray)
            return hashlib.md5(numpy.getbuffer(msg)).hexdigest()