Pad Buffer
This package provides two function (bufferPadStart
and bufferPadEnd
).
They can be used to add padding to a buffer.
By default, the padding consists of null bytes, but you can choose a custom filling value.
Usage
Importing the functions
const bufferPadStart bufferPadEnd =
or
Using the functions
// <Buffer 01 02 03>const buffer = Buffer // <Buffer 00 00 01 02 03>const padStartResult = // <Buffer 01 02 03 00 00>const padEndResult = // <Buffer 09 09 01 02 03>const customPaddingResult =