Explorer

cbor.uint

description
Read count bytes from offset as a big-endian unsigned integer after acc
type
Fn(bytes: List<Number>, offset: Number, count: Number, acc: Number) -> Union{#none, #some(Number)}
expression
fn(bytes$0, offset$1, count$2, acc$3) =>
  match @core.equal(left: $2, right: 0) {
    true =>
      #some($3),
    false =>
      match @core.list-get(list: $0, index: $1) {
        #some(byte$4) =>
          @cbor.uint(
            bytes: $0,
            offset: @core.plus(left: $1, right: 1),
            count: @core.minus(left: $2, right: 1),
            acc: @core.bit-or(left: @core.shift-left(left: $3, right: 8), right: $4)
          ),
        #none(_) =>
          #none
      }
  }
visibility
public
cbor.uint (project cbor, branch main, snapshot 5bvML2Im-osGmgnKJsp0FwmfSMONephnrgdWQboV3-E)
id: 2na0vMGwhs3dMDlXWsgEbVfWvM3UG7n_I9piBmleBS0
content hash: qZV-8-CHb9AFV6MTy9EmD8l-l0SqAqBX34ts1iAX2Ys