<p>我有一个小代码,它接受用户输入并加密。这不是一个哈希公式,但它只是一个简单的谜代码。简化的代码是:</p>
<pre><code>def Hash (string):
for x in range(0, len(string)):
if x == 0:
HashC = str(ord(string[x:x+1]))
else:
HashC = HashC+str(ord(string[x:x+1]))
print(HashC)
U = HashC
U = input("What do you want to hash? ")
Hash(U)
print(U)
</code></pre>
<p>打印的输出告诉我转换过程中发生了什么</p>
<pre class="lang-none prettyprint-override"><code>> What do you want to hash? Test
> 84101
> 84101115
> 84101115116
> Test
</code></pre>
<p>我想要它输出什么</p>
<pre class="lang-none prettyprint-override"><code>> What do you want to hash? Test
> 84101
> 84101115
> 84101115116
> 84101115116
</code></pre>
<p>因为我希望代码将字符串更改为“<em>加密的</em>”代码</p>