Re: [yang-doctors] Definition for base64

Andy Bierman <andy@yumaworks.com> Fri, 17 August 2018 17:40 UTC

Return-Path: <andy@yumaworks.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 3B23A130E4C for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 10:40:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 CF8P_5Gjvsqw for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 10:40:11 -0700 (PDT)
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) (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 9DF63130F43 for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 10:40:10 -0700 (PDT)
Received: by mail-lf1-x12e.google.com with SMTP id g6-v6so6431523lfb.11 for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 10:40:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Jno1tADYkb04DB2fEylePt124E0VJpUX2f4Lsh2Dn2s=; b=SPPrR0+fjrzY0SPuOIYsTrOwls2jSEtiqB7stQkL/GZwKh31xfILQM1yEHkMBIgEnW 1+mceFEJg3iGD5fAmbjmB/squWeEznNrE9R9twKBQCU5rmqh5CYDjRDEpWsCiBwJbrtL 6jcvt6bRy/q+FeQIlNWrSYR7l0k7G3LRBmr4Ye8PuOdoEOQpuMerzHNg2JxYXLLEvdjg wBae05KsNqtAIcTWktSYhXCHwhAQqKcUmjf4brCW3XtoW4wqxtNznFfCE3hMA88X60NL DeXHw87j+nBUNadJVPOjdC7R74+SECfB+B4aZ4qTiC+ayp4Apji2hRmgHqhUmcX4vjhl G5xw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Jno1tADYkb04DB2fEylePt124E0VJpUX2f4Lsh2Dn2s=; b=Z8QrAQlRgrOcyTrfzR0lBvpD2QrQq8DORhaBaukIF4/md0NOpVMun6b03ajiDF5wDd 4Wo/ZVNQtnN1/C7L00ui0v/XzGJAkQFS9eLFg/T8LJNo5aXYyREGeDW5lvlApZqpy3Tl VOI3cv54mp88prj3GnaVcs214F5TJGLNhXMUdhSFaBRn1mmYOKny75f7ScK9GJx1jup7 /rayl7UYuqXy+BNTo5dctU0mGf4+bF70V6xXhKchyRssewPSdJO6Sa/hi8aCNQwkvo9J ybhtQJKqxPEoPqUHqkatyOJbrnGQnA73uikaQyvaeNuT9GDKAWSqb2fwCVWcxcEmAqum G9vw==
X-Gm-Message-State: AOUpUlFeZTVs8nzAvyoQge34dVoGHYbn0Y14Nb0uPi1pW4e5fObcixd4 u1gz/NfiMiNIrARSsdZe5NmdyQ++c5lH1CEs8J0anmzh
X-Google-Smtp-Source: AA+uWPySDzdAnhXForgODqUpN0PArEagJCPUECgsEWZZ/JqFirS+uLElkKPPeTSH35++uspXFaKSLZxcu573ajE9yag=
X-Received: by 2002:a19:c1c4:: with SMTP id r187-v6mr9108836lff.90.1534527608647; Fri, 17 Aug 2018 10:40:08 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a19:aa46:0:0:0:0:0 with HTTP; Fri, 17 Aug 2018 10:40:07 -0700 (PDT)
In-Reply-To: <09CD4A1F-2A3C-4E42-A0D3-C5A475947724@gmail.com>
References: <09CD4A1F-2A3C-4E42-A0D3-C5A475947724@gmail.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Fri, 17 Aug 2018 10:40:07 -0700
Message-ID: <CABCOCHT6vj+Y1L7CprHvcYNmLtF9P5UDRw8H_uuD7ZKgqwRJog@mail.gmail.com>
To: Mahesh Jethanandani <mjethanandani@gmail.com>
Cc: YANG Doctors <yang-doctors@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000000306f80573a50da0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/D8CosH2B9TNqRFgrN8_9tSBy_p8>
Subject: Re: [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:40:13 -0000

Hi,

Aren't you confusing YANG data types with message encoding?
A base64 string at the YANG level is just a string. There are no
non-printable chars
like a binary string could have.  Not sure why the type base64 is
interesting in YANG data models.


Andy


On Fri, Aug 17, 2018 at 10:26 AM, Mahesh Jethanandani <
mjethanandani@gmail.com> wrote:

> 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
>
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors
>