[yang-doctors] Definition for base64

Mahesh Jethanandani <mjethanandani@gmail.com> Fri, 17 August 2018 17:25 UTC

Return-Path: <mjethanandani@gmail.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9B1E0130DD5 for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 10:25:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KmZTy8MsEm-M for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 10:25:56 -0700 (PDT)
Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4A8881252B7 for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 10:25:56 -0700 (PDT)
Received: by mail-pf1-x430.google.com with SMTP id e13-v6so3782105pff.7 for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 10:25:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=gkOF5/X0vqsPlActH03rHsF2caKRVBz2rrabF2d+hj0=; b=aDAwfUkmgW2UeB+NsOHmxxa5oruVratXoG2yXBRDn/7fn2LyCGup9jLH0Fvklu16N6 ERHqjzLIQ/QlWRYxherjqobGLHXCTFbYVE1mTNrg+gSGY6mnJ2JwTKHTEcYm+wdYSd3V 9GtnZpogUh3AnSk0C75ZokwNKL+ixxPIJ1hKOwl+fNYEtTkNLFFpqM21730Wkp3VdBVA KALyEqVaT+TOx01Hd/rFJv1qVsF/GgzL42SZVrwYmsM8b0eXSQAONtsUXkaFaPmVRE1h NFPzgQyfRyjFplJo9zxv6zy2Y3aqjtFndsxqREvKklr7W0nVeixtcRMMb44wGEHci7DU PANQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=gkOF5/X0vqsPlActH03rHsF2caKRVBz2rrabF2d+hj0=; b=YunaHXYhXoyZ2jyfbp2ZGUbJMD4BIM+wzkiKsWUnmsw1Dc1CrxRKSGzTY/9iXPM2UW WN8Qjekvo3hZRPCSk5IpZCwseKWPv5UXLKyrVsRVbE0ST8+xfldqVHhKM4pm4fPQoVN5 8/FilsnYfuE/L3Dn3Qi/bLMRGaLNyGZUu1rkyvcZVYdRPoXaHavT9fmYRlZiD1g11hwH gJelJNH48m8DOTsc/3CfagfksqhpObz8ocW0ULxy/5p2TCpFa1Y7uTo1eMI+fL0jvrfm hVNwBD4UHjY2M0PnjEaE3zJvSS48I1b36Xw4oyVCWOoZ3nGp76QDhpgRcXWB1m0k3/7B zTDQ==
X-Gm-Message-State: AOUpUlGd5n/kubsMP+Am2KY6g3o9ZE465/v4w3qR5+oueWzwcndjX7nj rrVgRufw/e3PhgfYTQzwKjC8W2Nc
X-Google-Smtp-Source: AA+uWPxaEh9CI8vP7fA8qG5ioUOWpeYsKPRUfoA+vfoBt+KUeicABhjyXNPQ2tlcJ01hp2vSDxyviQ==
X-Received: by 2002:a63:d74f:: with SMTP id w15-v6mr33971151pgi.306.1534526755627; Fri, 17 Aug 2018 10:25:55 -0700 (PDT)
Received: from ?IPv6:2601:647:4700:1280:15a2:f843:dd20:11db? ([2601:647:4700:1280:15a2:f843:dd20:11db]) by smtp.gmail.com with ESMTPSA id j1-v6sm3906237pfk.125.2018.08.17.10.25.54 for <yang-doctors@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 10:25:54 -0700 (PDT)
From: Mahesh Jethanandani <mjethanandani@gmail.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Message-Id: <09CD4A1F-2A3C-4E42-A0D3-C5A475947724@gmail.com>
Date: Fri, 17 Aug 2018 10:26:29 -0700
To: YANG Doctors <yang-doctors@ietf.org>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/0oXvRt9RewU4-4dsRdklPPJWeuw>
Subject: [yang-doctors] Definition for base64
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Aug 2018 17:25:58 -0000

Is there a definition for base64 defined in one of the YANG models? I would prefer to use one if it defined. If not, I was going to define one as

 typedef base64 {
    type string {
      pattern '(([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|'
            + '[A-Za-z0-9+/]{2}==)?){1}';
    }
    description
      "A binary-to-text encoding scheme to represent binary data in
       an ASCII string format.";
    reference
      "RFC 4648, The Base16, Base32, and Base64 Data Encodings";
  }

Mahesh Jethanandani
mjethanandani@gmail.com