← all modules
Sky.Core.Bytes
Sky.Core.Bytes
Sky.Core.Bytes — byte-buffer helpers (Layer 3 Sky source).
Types
type alias Bytes
Values
append : Bytes -> Bytes -> Bytes
`append a b` — concatenate two byte buffers.
empty : Bytes
fromBase64 : String -> Maybe Bytes
`fromBase64 s` — parse a standard-base64 buffer. `Nothing`
fromHex : String -> Maybe Bytes
`fromHex hex` — parse a hex-encoded byte buffer (case
fromString : String -> Bytes
`fromString s` — interpret a Sky string's bytes as a `Bytes`
isEmpty : Bytes -> Bool
length : Bytes -> Int
Byte count of the buffer — Go's `len(s)`, NOT a rune count.
slice : Int -> Int -> Bytes -> Bytes
`slice start end b` — substring on BYTE indices. Negative
toBase64 : Bytes -> String
`toBase64 b` — standard-base64 encode. Inverse of
toHex : Bytes -> String
`toHex b` — hex-encode (lowercase). Inverse of `fromHex`.
toString : Bytes -> Maybe String
`toString b` — try to interpret a `Bytes` buffer as a valid