buffer.atob(data)
稳定性: 3 - 旧版。请改用
Buffer.from(data, 'base64')。data<any> 基于 Base64 编码的输入字符串。
将一串 Base64 编码的数据解码为字节,然后使用 Latin-1(ISO-8859-1)将这些字节编码为字符串。
【Decodes a string of Base64-encoded data into bytes, and encodes those bytes into a string using Latin-1 (ISO-8859-1).】
data 可以是任何可以被强制转换为字符串的 JavaScript 值。
【The data may be any JavaScript-value that can be coerced into a string.】
此函数仅为兼容旧版 Web 平台 API 而提供,不应在新代码中使用,因为它们使用字符串来表示二进制数据,并且早于 JavaScript 中引入的类型化数组。
对于使用 Node.js API 运行的代码,应使用 Buffer.from(str, 'base64') 和 buf.toString('base64') 在 Base64 编码字符串与二进制数据之间进行转换。