Function str2buf

  • Convert a string to a Buffer. If encoding is not specified, hex-encoding will be used if the input is valid hex. If the input is valid base64 but not valid hex, base64 will be used. Otherwise, utf8 will be used.

    Returns

    Buffer containing the input data.

    Parameters

    • str: string

      String to be converted.

    • Optional enc: BufferEncoding

      Encoding of the input string.

    Returns Buffer

Generated using TypeDoc