Uint8Array base64 and hex conversion
Limited availability
The Uint8Array
object methods fromBase64()
, toBase64()
, and setFromBase64()
convert to and from base64 strings. The fromHex()
, toHex()
, and setFromHex()
methods convert to and from hex strings.
Learning resources on MDN
- Uint8Array.fromBase64()
- Uint8Array.fromHex()
- Uint8Array.prototype.setFromBase64()
- Uint8Array.setFromHex()
- Uint8Array.prototype.toBase64()
- Uint8Array.prototype.toHex()
Browser support
- Chrome ❌ See crbug.com/42204568
- Chrome Android ❌ See crbug.com/42204568
- Edge ❌ See crbug.com/42204568
- Firefox 133 Released on 2024-11-26
- Firefox for Android 133 Released on 2024-11-26
- Safari 18.2 Released on 2024-12-11
- Safari on iOS 18.2 Released on 2024-12-11
Specifications
- Uint8Array to/from base64, from TC39 (Ecma International).