{"type":"rich","version":"1.0","title":"wono wrote","author_name":"wono (npub1d7…54jw9)","author_url":"https://nostr.now/npub1d7zfm3ec0axunyd0ydsttjlxr60ujcts5zt054murwgh0jjcst6sl54jw9","provider_name":"njump","provider_url":"https://nostr.now","html":"/run py\n\ndef encode_secret_emoji(emoji: str, text: str) -\u003e str:\n    \"\"\"Encode text to Secret Emoji\"\"\"\n    VS_START      = 0xfe00  \n    VS_SUPP_START = 0xe0100 \n  \n    utf8_bytes = text.encode('utf-8')\n    result = []\n\n    for byte in utf8_bytes:\n       \n        if byte \u003c= 15:\n            cp = VS_START + byte           \n        else:\n            cp = VS_SUPP_START + byte - 16  \n        result.append(chr(cp))\n\n    return emoji + ''.join(result)\n\n\ndef decode_secret_emoji(text: str) -\u003e str:\n    \"\"\"Decode Secret Emoji to text\"\"\"\n    VS_START,      VS_END      = 0xfe00,   0xfe0f \n    VS_SUPP_START, VS_SUPP_END = 0xe0100,  0xe01ef   \n\n    decoded = []\n    i = 0\n\n    while i \u003c len(text):\n        cp = ord(text[i])\n\n        if 0xD800 \u003c= cp \u003c= 0xDBFF and i + 1 \u003c len(text):\n            low = ord(text[i + 1])\n            if 0xDC00 \u003c= low \u003c= 0xDFFF:\n                cp = 0x10000 + ((cp - 0xD800) \u003c\u003c 10) + (low - 0xDC00)\n                i += 2\n            else:\n                i += 1\n                continue\n        else:\n            i += 1\n\n        if VS_START \u003c= cp \u003c= VS_END:\n            decoded.append(cp - VS_START)          \n        elif VS_SUPP_START \u003c= cp \u003c= VS_SUPP_END:\n            decoded.append(cp - VS_SUPP_START + 16) \n    return bytes(decoded).decode('utf-8', errors='replace')\n\nprint(decode_secret_emoji(\"🥟󠇓󠅱󠅺󠇓󠅱󠆓󠇓󠅱󠆡󠇓󠅱󠅴\"))"}
