function

ffi.read.u64

function u64(
ptr: number | bigint | Pointer,
byteOffset?: number
): bigint;

Read an unsigned 64-bit integer at ptr + byteOffset, as a bigint

Behaves like DataView, but is usually faster because it doesn't create a DataView or ArrayBuffer.

Bun catches some invalid pointers, but not all. Passing an invalid pointer, or reading past the end of the memory it points to, can crash the program or cause undefined behavior.

@param ptr

The memory address to read

@param byteOffset

bytes to skip before reading

Referenced types

type Pointer = number & { __pointer__: null }