oracle / graaljs

GraalJS – A high-performance, ECMAScript compliant, and embeddable JavaScript runtime for Java
https://www.graalvm.org/javascript/
Universal Permissive License v1.0
1.82k stars 191 forks source link

[GR-57591] Implement Uint8Array to/from base64 and hex #856

Open fniephaus opened 1 month ago

fniephaus commented 1 month ago

TL;DR

We plan to implement Uint8Array to/from base64 and hex in GraalJS.

Details

Base64 is a common way to represent arbitrary binary data as ASCII. JavaScript has Uint8Arrays to work with binary data, but no built-in mechanism to encode that data as base64, nor to take base64'd data and produce a corresponding Uint8Arrays. This is a proposal to fix that. It also adds methods for converting between hex strings and Uint8Arrays.