# Function toUint8Array

- toUint8Array(data: ArrayBuffer | ArrayBufferView<ArrayBufferLike>): Uint8Array

  Converts various ArrayBuffer-like types to Uint8Array. Handles ArrayBuffer, ArrayBufferView (including typed arrays), and passes through existing Uint8Array.

  #### Parameters

  - data: ArrayBuffer | ArrayBufferView<ArrayBufferLike>

    The ArrayBuffer or ArrayBufferView to convert

  #### Returns Uint8Array

  A Uint8Array view of the data

  - Defined in rivetkit-typescript/packages/rivetkit/src/utils.ts:64