convert coerced sha back into numeric list

def decode_from_sha(sha):
    """convert coerced sha back into numeric list"""
    if isinstance(sha, str):
        sha = sha.encode('utf-8')
    return codecs.decode(re.sub(rb'(00)*$', b'', sha), "hex_codec")