Reference
std/bytes
std/bytes
Byte strings: conversion from and to arrays and text, slices and concatenation.
narra
import * as Bytes from "std/bytes"
The guide teaches it in chapter 11, Files and the system.
This page is generated by scripts/std/generate.nra from narrac query --json interface std/bytes. Do not edit it.
Functions
at
narra
export function at(data: bytes, index: int): Option<u8>
Effects: none.
concat
narra
export function concat(first: bytes, second: bytes): bytes uses alloc
Effects: alloc.
fromArray
narra
export function fromArray(items: Array<u8>): bytes uses alloc
Effects: alloc.
fromString
narra
export function fromString(text: string): bytes
Effects: none.
length
narra
export function length(data: bytes): int
Effects: none.
slice
narra
export function slice(data: bytes, start: int, end: int): Option<bytes> uses alloc
Effects: alloc.
toArray
narra
export function toArray(data: bytes): Array<u8> uses alloc
Effects: alloc.
toString
narra
export function toString(data: bytes): Result<string, string> uses alloc
Effects: alloc.