bun-convert-an-arraybuffer-to-an-array-of-numbers
Convert an ArrayBuffer to an array of numbers
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Convert an ArrayBuffer to an array of numbers
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Configure a private registry for an organization scope with bun install
Speed up JavaScript execution with bytecode caching in Bun's bundler
Bun's bundler has built-in support for CSS with modern features
Migration guide from esbuild to Bun's bundler
Generate standalone executables from TypeScript or JavaScript files with Bun
Build fullstack applications with Bun's integrated dev server that bundles frontend assets and handles API routes
| name | Bun Convert an ArrayBuffer to an array of numbers |
| description | Convert an ArrayBuffer to an array of numbers |
To retrieve the contents of an ArrayBuffer as an array of numbers, create a Uint8Array over of the buffer. and use the Array.from() method to convert it to an array.
const buf = new ArrayBuffer(64);
const arr = new Uint8Array(buf);
arr.length; // 64
arr[0]; // 0 (instantiated with all zeros)
The Uint8Array class supports array indexing and iteration. However if you wish to convert the instance to a regular Array, use Array.from(). (This will likely be slower than using the Uint8Array directly.)
const buf = new ArrayBuffer(64);
const uintArr = new Uint8Array(buf);
const regularArr = Array.from(uintArr);
// number[]
See Docs > API > Binary Data for complete documentation on manipulating binary data with Bun.