Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要加密一个整数,但所有的加密库都只支持字符串。
在Ruby中将整数转换为二进制字符串的正确方法是什么?(不是'10111',我认为它是ASCII值)
编辑:我没有考虑将 Rijndael 作为流加密。
流加密算法适用于流——一系列字符。您可以将其视为整数或换行符。
Rijndael(分组密码)会很乐意接受非 128 位字符串(流,如果你愿意的话)并用 0 填充结尾。查看文档并试一试。