Decode Base64 to Hexadecimal string with javascript

前端 未结 5 1194
有刺的猬
有刺的猬 2020-12-06 09:52

Needing to convert a Base64 string to Hexadecimal with javascript.

Example:

var base64Value = \"oAAABTUAAg==\"

Need conversion m

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 10:40

    Why not try the following code?:

    const buffer = Buffer.from(rawData, 'base64');
    const bufString = buffer.toString('hex');
    

提交回复
热议问题