Blob
Binary blobs
Blob
type Blob = Prim.Types.Blob
An immutable, possibly empty sequence of bytes.
Given b : Blob
:
-
b.size() : Nat
returns the number of bytes in the blob; -
b.vals() : Iter.Iter<Nat8>
returns an iterator to enumerate the bytes of the blob.
(Direct indexing of Blobs is not yet supported.)
hash
let hash : (b : Blob) -> Nat32
Returns a (non-cryptographic) hash of 'b'
fromArray
let fromArray : [Nat8] -> Blob
Creates a blob from an array of bytes, by copying each element.
fromArrayMut
let fromArrayMut : [var Nat8] -> Blob
Creates a blob from a mutable array of bytes, by copying each element.
toArray
let toArray : Blob -> [Nat8]
Creates an array of bytes from a blob, by copying each element.
toArrayMut
let toArrayMut : Blob -> [var Nat8]
Creates a mutable array of bytes from a blob, by copying each element.