JS Built-ins
TypedArrayfromintermediate

Uint8Array.from() from String

πŸ“– Usage Example
const bytes = Uint8Array.from('ABC', c => c.charCodeAt(0));
// Uint8Array [65, 66, 67]

Convert string characters to their byte codes using charCodeAt.

Create a Uint8Array from a string of digit characters, parsing each character as an integer.

πŸ’‘ Hints (1)
  • β€’ Use Uint8Array.from(str, x => parseInt(x))