模块 nonebot_plugin_marshoai.tools.marshoai_megakits.mk_morse_code
async func morse_encrypt(msg: str)
源代码 或 在GitHub上查看
python
async def morse_encrypt(msg: str):
result = ''
msg = msg.upper()
for char in msg:
if char in MorseEncode:
result += MorseEncode[char]
else:
result += '..--..'
result += ' '
return result
async func morse_decrypt(msg: str)
源代码 或 在GitHub上查看
python
async def morse_decrypt(msg: str):
result = ''
msg_arr = msg.split()
for char in msg_arr:
if char in MorseDecode:
result += MorseDecode[char]
else:
result += '?'
return result