Library API
    Preparing search index...

    Function padTo

    • Pads a string at the end so that its length is a multiple of the specified block size.

      Parameters

      • str: string

        The input string to pad

      • multiple: number = 4

        The block size or multiple to align to (default: 4)

      • fill: string | number = '='

        The fill character or string to append (default: '=')

      Returns string

      The padded string aligned to the multiple

      padTo('abc', 4, '='); // 'abc='
      padTo('abcd', 4, '='); // 'abcd'