Skip to content

toBinary

toBinary(string, encoding?) → binary · Binary

Create binary data from a string with the specified encoding.

  • string (required): the string to convert

  • encoding (optional): character encoding (default "UTF-8")

utlx
let data = toBinary("Hello World", "UTF-8")
{
  length: binaryLength(data)
}

Released under AGPL-3.0.