Explorer

std.base64-sextet

description
The 6-bit value of a Base64 / Base64URL character code, or -1
type
Fn(code: Number) -> Number
expression
fn(code$0) =>
  match @core.and(left: @core.less-than(left: 64, right: $0), right: @core.less-than(left: $0, right: 91)) {
    true =>
      @core.minus(left: $0, right: 65),
    false =>
      match @core.and(left: @core.less-than(left: 96, right: $0), right: @core.less-than(left: $0, right: 123)) {
        true =>
          @core.minus(left: $0, right: 71),
        false =>
          match @core.and(left: @core.less-than(left: 47, right: $0), right: @core.less-than(left: $0, right: 58)) {
            true =>
              @core.plus(left: $0, right: 4),
            false =>
              match $0 {
                43 =>
                  62,
                45 =>
                  62,
                47 =>
                  63,
                95 =>
                  63,
                _ =>
                  -1
              }
          }
      }
  }
visibility
public
std.base64-sextet (project definy, branch snapshot-terms, snapshot ITPh_tTKphq4xOBcY4nA69GG9L2laow7SAtvVJWLQaQ)
id: t98twVMeFC41SlxfK47cGySLwpChI18Ve03cevZC-OE
content hash: mOxDD95ae7k28w6aL5LOv3NfpF98MFoMF_Azqwm1kyU