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.
Buffer containing the input data.
String to be converted.
Optional
Encoding of the input string.
Generated using TypeDoc
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.