base64编码字符串是否唯一? [英] Is a base64 encoded string unique?
问题描述
我找不到答案。如果我用Base64编码一个字符串,那么编码的输出将基于字符串是唯一的?我问,因为我想创建一个包含用户信息的令牌,所以我需要确保根据信息输出是唯一的。
I can't find an answer to this. If I encode a string with Base64 will the encoded output be unique based on the string? I ask because I want to create a token which will contain user information so I need make sure the output will be unique depending on the information.
例如,如果我编码 UnqUserId:987654321 Timestamp:01/02/03这将是独一无二的,所以无论我把它放在哪里都不会有碰撞?
For example if I encode "UnqUserId:987654321 Timestamp:01/02/03" will this be unique so no matter what other userid I put it in there will never be a collision?
推荐答案
这是一种不是加密的编码。由于您可以解码该字符串,因此必须是唯一的。
It's an encoding not an encryption. Since you can decode the string it must be unique.
这篇关于base64编码字符串是否唯一?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!