BASE64解码-JavaScript -PHP
我的下一个字符串带有基本64编码:
aJjueq22q2O202ZzZdpjPO6Cr32p0cc22jeaceupcjd2Z2SuPg2J6rwupOQzS62e3cC2eWS2gC2P232a2p925w==
当我在php中使用base64_decode函数解码时,我收到了下一个字符串:
$key = base64_decode($key);
.3K��yd-}ڟv7qr7vgd>
但是在JS中,我完成了下一个字符串:
const key = Buffer.from(key, "base64").toString("ascii");
我收到了另一个解码的字符串:
h↑nz-6+cj<.$d3K-▲]@6yd6-☼[}→Z▼vgvgd.>
怎么可能?我需要像第一个(PHP)这样的字符串
I have the next string with base 64 encoded:
aJjueq22q2O202ZzZdpjPO6Cr32p0cc22jeaceupcjd2Z2SuPg2J6rwupOQzS62e3cC2eWS2gC2P232a2p925w==
When I decoded with base64_decode function in PHP I received the next string:
$key = base64_decode($key);
.3K��yd-}ڟv7qr7vgd>
But in JS I did the next:
const key = Buffer.from(key, "base64").toString("ascii");
And I received a different decoded string:
h↑nz-6+cj<.$d3K-▲]@6yd6-☼[}→Z▼vgvgd.>
How is it possible? I need to get a string like the first (PHP)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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