def decode
import bend-kit-webhooks@0.11.0.1/webhooks.bend as Webhooksimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
151# A signature's octets: hex (Stripe, GitHub) or canonical base64 (Standard Webhooks).
152def decode(+hex: Bool, +s: String) -> Maybe<&1, Bytes.Bytes>:
153 match hex:
154 case True{}:
155 Bytes.from_hex(s)
156 case False{}:
157 b64(s)