package bls12-381-js-gen

  1. Overview
  2. Docs

Binding to Uint8Array. Compatible with >= ES6 only

include TYPED_ARRAY with type elt = int and type t = Js_of_ocaml.Typed_array.uint8Array Js_of_ocaml.Js.t
include JS_OBJECT with type t = Js_of_ocaml.Typed_array.uint8Array Js_of_ocaml.Js.t
val to_any_js : t -> Js_of_ocaml.Js.Unsafe.any
val to_string : t -> string

Equivalent to toString on the object in JavaScript

type elt = int

OCaml type to represent the elements of the typed array.

val name : string

Name of the typed array. Example: Uint8Array, Uint16Array

val create : ?offset:Number.t -> ?length:Number.t -> ArrayBuffer.t -> t
val buffer : t -> ArrayBuffer.t

buffer a returns the underlying buffer of the array. Equivalent to a.buffer in JavaScript

val byte_length : t -> Number.t

byte_length a returns the number of bytes of the typed array. Equivalent to a.byteLength in JavaScript

val set : t -> int -> elt -> t

set a i x is equivalent to ai = x in JavaScript

val slice : t -> int -> int -> t

slice array a b returns array[a], ..., array[b]

val to_bytes : t -> bytes

Convert to bytes