lineBreak

fun lineBreak(interval: Byte): Base64.Builder(source)

DEFAULT: 0 (i.e. disabled)

If greater than 0, when interval number of encoded characters have been output, the next encoded character will be preceded with the new line character \n.

A great value is 64, and is what both Default.config and UrlSafe.config use.

NOTE: This setting is ignored if isLenient is set to false.

e.g.

isLenient(enable = true)
lineBreak(interval = 0)
// SGVsbG8gV29ybGQh

isLenient(enable = true)
lineBreak(interval = 10)
// SGVsbG8gV29ybGQh
// 9ybGQh

isLenient(enable = false)
lineBreak(interval = 10)
// SGVsbG8gV29ybGQh

See also