Skip to main content

setLengthLeft

Callable

  • setLengthLeft(msg: Buffer, length: number): Buffer

  • Left Pads a Buffer with leading zeros till it has length bytes. Or it truncates the beginning if it exceeds.


    Parameters

    • msg: Buffer

      the value to pad (Buffer)

    • length: number

      the number of bytes the output should be

    Returns Buffer

    (Buffer)