buffer2address

0.0.2 • Public • Published

node-buffer2address

Node.js module to retrieve memory address of Buffer

About

This tiny module allows to retrieve the memory address of a Node.js Buffer as a BigInt. This address can be used for interoperability with native code.

Installation

npm install buffer2address

or

yarn add buffer2address

API

buffer2address(buf) => BigInt

Returns the address of a Node.js buffer instance as a BigInt. On 32-bit systems we could actually return a Number but to be consistent over all architectures always BigInts are returned.

Example

import buffer2address from "buffer2address";

const buf = Buffer.alloc(32);
console.log(`buffer address = ${buffer2address(buf)}`);

Readme

Keywords

none

Package Sidebar

Install

npm i buffer2address

Weekly Downloads

0

Version

0.0.2

License

LGPL 2.1

Unpacked Size

35.2 kB

Total Files

9

Last publish

Collaborators

  • simon.kadisch