Explorer

std.base64-groups

description
The bytes of the groups from start to end (exclusive) of the length characters, concatenating halves
type
Fn(codes: List<Number>, length: Number, start: Number, end: Number) -> Union{#none, #some(List<Number>)}
expression
fn(codes$0, length$1, start$2, end$3) =>
  let count$4 = @core.minus(left: $3, right: $2);
  match @core.less-than(left: $4, right: 2) {
    true =>
      match @core.equal(left: $4, right: 1) {
        true =>
          let index$5 = @core.multiply(left: $2, right: 4);
          @std.base64-group(codes: $0, index: $5, count: @std.min(a: 4, b: @core.minus(left: $1, right: $5))),
        false =>
          #some([])
      },
    false =>
      let middle$6 = @core.plus(left: $2, right: @core.divide(left: $4, right: 2));
      match @std.base64-groups(codes: $0, length: $1, start: $2, end: $6) {
        #some(left$7) =>
          match @std.base64-groups(codes: $0, length: $1, start: $6, end: $3) {
            #some(right$8) =>
              #some(@core.list-concat(left: $7, right: $8)),
            #none(_) =>
              #none
          },
        #none(_) =>
          #none
      }
  }
visibility
public
std.base64-groups (project definy, branch local-host-wasi-io, snapshot 6q6wel2IrvXMEdXtZFbi0BgBld-vO0GChR39-U-GIJY)
id: maDvMnPpm7y1JtaENq2AiJV5cl770idL8iySS8_H9Xc
content hash: YkSA9nn24VjUQ6NNs8pQWqJ3aI9bqyVpZC1qaFywg_8