fus 2.4.1
import "./main" all

$base64: require("./base64")

toBase64'export: bytes -> $base64.fromByteArray(bytes)

toString'export: bytes ->
    decodeURIComponent(
        Array.from(bytes)
        .map(m -> "%" + m..format{integerSize: 2, radix: 16}.toUpperCase())
        .join("")
    )

toHex'export: bytes ->
    Array.from(bytes)
    .map(m -> m..format{integerSize: 2, radix: 16})
    .join("")

bound'export: bytes -> bytes.length - 1
