使用缓冲区的转换不同于base64.fromarraybuffer()。为什么会发生?
Tempid看起来像这样: new Uint8array([1,252,232,40,235,180,121,67,67,150,7 ,175、209、33、104、1、251、127、70、88、178、57、216、48、202、202、248、248、170、190、190、190、126、39、111、111、231、116、69 )
,133、183、59、54、1、193、110、191、48、235、14、14、172、162、113、181、147、83、90 ] 来自(tempid).toString('base64'); 返回以下内容: afzokou0euowb25jw5ywuoojvnfmtk/riwgb+39GWLI52DKOFJZQR5+J2/ndewftzs2acfzs2acfuvzdrdqyi1bwtu1bwtu1bwtu1o
0、7、110
,99、195、156、150、82、131、163、84、209、102、102、102、175、209、33、104、151、251、127、70、70、88、178、178、57、57、57、216、48、202 ,161、248、243、170、190、126、39、111、231、116、69、69、133、183、59、54、1、193、110、110、191、48、235、135、14、142、172、172、162、213 ,181,147,83,90])
base64.fromarraybuffer(predid,true);
返回以下内容:
i1bwtu1o
非常相似,但是有几个差异('='最后,'/'而不是'_'和' - ' - 而不是'+'。 为什么会发生?
TempId looks like this:new Uint8Array([1, 252, 232, 40, 235, 180, 121, 67, 150, 7, 110, 99, 195, 156, 150, 82, 131, 163, 84, 209, 102, 76, 175, 209, 33, 104, 1, 251, 127, 70, 88, 178, 57, 216, 48, 202, 161, 248, 243, 170, 190, 126, 39, 111, 231, 116, 69, 133, 183, 59, 54, 1, 193, 110, 191, 48, 235, 14, 172, 162, 213, 181, 147, 83, 90])
Buffer.from(tempId).toString('base64');
returns this:AfzoKOu0eUOWB25jw5yWUoOjVNFmTK/RIWgB+39GWLI52DDKofjzqr5+J2/ndEWFtzs2AcFuvzDrDqyi1bWTU1o=
CredId looks like this:
new Uint8Array([1, 252, 232, 40, 235, 180, 121, 67, 150, 7, 110, 99, 195, 156, 150, 82, 131, 163, 84, 209, 102, 76, 175, 209, 33, 104, 1, 251, 127, 70, 88, 178, 57, 216, 48, 202, 161, 248, 243, 170, 190, 126, 39, 111, 231, 116, 69, 133, 183, 59, 54, 1, 193, 110, 191, 48, 235, 14, 172, 162, 213, 181, 147, 83, 90])
base64.fromArrayBuffer(credId, true);
returns this:
AfzoKOu0eUOWB25jw5yWUoOjVNFmTK_RIWgB-39GWLI52DDKofjzqr5-J2_ndEWFtzs2AcFuvzDrDqyi1bWTU1o
As you can see, the token are very similar, but there are a couple of differences ('=' at the end, '/' instead of '_', and '-' instead of '+'.
Why does that happen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论