def encode_routing_key(cls, routing_key: str) -> str:
def encode(match: Match) -> str:
return '___' + binascii.hexlify(match.group(1).encode('utf-8')).decode('utf-8') + '_'
return re.sub(r'([^a-zA-Z0-9_*#,;.:<>!"%&/\(\)\[\]\{\}\\=?\'^`~+|@$ -])', encode, routing_key)
评论列表
文章目录