这是一个Python代码示例:
def decode(s):
for i in range(len(s)):
print compat_ord(s[i])
def compat_ord(c):
if type(c) is int:
return c
else:
return ord(c)
decode(base64.b64decode('NwXYSw8YI7nb2PnE8eJxVoLzuBQ81wjOXh4='.encode('ascii')))
输出
55 5 216 75 15 24 35 185 219 216 249 196 241 226 113 86 130 243 184 20 60 215 8 206 94 30
我的Java版本
byte[] s = Base64.getDecoder().decode("NwXYSw8YI7nb2PnE8eJxVoLzuBQ81wjOXh4=".getBytes("ascii"));
for(int i= 0;i<s.length;i++){
System.out.println(s[i]);
}
输出结果
55 5 -40 75 15 24 35 -71 -37 -40 -7 -60 -15 -30 113 86 -126 -13 -72 20 60 -41 8 -50 94 30
我的问题
为什么有些值相同,而有些不同