擅长:python、mysql、java
<p>使用base64库</p>
<pre><code> import base64
c="tamilnadu"
c=base64.b64encode(bytes(c, 'utf-8')) // b'dGFtaWxuYWR1'
c1=base64.b64decode(c)
c=str(c).replace("'","") // bdGFtaWxuYWR1
print("Encode",c[1:]) // dGFtaWxuYWR1
c1=str(c1).replace("'","") // b'tamilnadu'
print("Decode=",c1[:1]) // tamilnadu
</code></pre>
<p>在编码之后,您需要替换<code>'</code>和第一个字符<code>b</code></p>