Re: [yang-doctors] Definition for base64

Mahesh Jethanandani <mjethanandani@gmail.com> Fri, 17 August 2018 17:46 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 CF03D130EE3 for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 10:46:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level:
X-Spam-Status: No, score=-1.998 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=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 8q5eklgwa0H0 for <yang-doctors@ietfa.amsl.com>; Fri, 17 Aug 2018 10:46:21 -0700 (PDT)
Received: from mail-pl0-x22f.google.com (mail-pl0-x22f.google.com [IPv6:2607:f8b0:400e:c01::22f]) (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 7135D130DCA for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 10:46:21 -0700 (PDT)
Received: by mail-pl0-x22f.google.com with SMTP id f6-v6so4046195plo.1 for <yang-doctors@ietf.org>; Fri, 17 Aug 2018 10:46:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=LP1UT9F1D2wJYhhePPzHvn7il/ey7/hhplcX7iFmtm8=; b=CL6zLmiFMTTKSRIcNi5t8e6ltSWQzhhLRKgJ3nEK4+p1gA+VhEKMbpIJNYQsd8N2F6 HOlAWwKqSxI1nLa9XzaD4hQP2dvUtmfa8MCNmAJWglXyEPwC+K06GzogUvmfaTlckJR/ jY0K/hRRoYQiWIABEo7Kk3GRY+g9ZFlIuCJ+1wkxRrS1ueTg9QDcVXvqdPr1D/QH+DyG AvAHmvoW8Gp87gDxqYj6ND52pv9sbiT0PT7E1RoifATvr758S15+h7UpXu3JEZM6AlO6 E4RnrkP2HHupAK1IduoYHFcTtn38ILO59pAp0NDQ3cEuAdfIa98OvnQvD2Xn5q0GYG7N YTKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=LP1UT9F1D2wJYhhePPzHvn7il/ey7/hhplcX7iFmtm8=; b=fY0iPopwa3Z66aTSMbnclRjHuAjB7d0PeqHA5lKUd+OqkWnXs+Sje1dlpi+KF7YhT1 +CBhgOjQh14/lGmDArTGJO0HwqN/LZkkoSc9rmRmm/KS8Fggtix0h9EkRRHLskN5wMGV uY23rYMkf3BVye0/Sq5xCM20B1a1N+pt88NXiBd6tHnkfHE1Aqskxa71GFybo45D/hZu gzQDX8pCwcFoI2guIhZ0vSiaBOjr1texx6364HvBb/LmK0DIl13SmfyKSbpQDgSyQQZn ijgBQAgU0Do8ZccAtX0S8Ni5goxI7+N50bCSTWYkPRmqlyHfQZxrciJ4325rxlMgKnv/ PWmg==
X-Gm-Message-State: AOUpUlFouqSMu88uWbF88hk4PEJcY5nW8Bvwgrv7J7vMrtMCY9yYK5V3 vCLmhISVfAognq+zGa6UToSsapp2
X-Google-Smtp-Source: AA+uWPxRNxttPeZEYUZUSVlhIg3f/iYeKxhxEawP2F2FLb6eF+iGLOavjqQs8JEfBeYIGGXJT30QjQ==
X-Received: by 2002:a17:902:b786:: with SMTP id e6-v6mr5178086pls.185.1534527981089; Fri, 17 Aug 2018 10:46:21 -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 n80-v6sm3986451pfb.95.2018.08.17.10.46.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Aug 2018 10:46:20 -0700 (PDT)
From: Mahesh Jethanandani <mjethanandani@gmail.com>
Message-Id: <2AD31000-4E60-47E7-9329-3DD4D17DA49D@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_1A23A5D1-5111-43B7-96B1-05CE9E831486"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Date: Fri, 17 Aug 2018 10:46:55 -0700
In-Reply-To: <CABCOCHT6vj+Y1L7CprHvcYNmLtF9P5UDRw8H_uuD7ZKgqwRJog@mail.gmail.com>
Cc: YANG Doctors <yang-doctors@ietf.org>
To: Andy Bierman <andy@yumaworks.com>
References: <09CD4A1F-2A3C-4E42-A0D3-C5A475947724@gmail.com> <CABCOCHT6vj+Y1L7CprHvcYNmLtF9P5UDRw8H_uuD7ZKgqwRJog@mail.gmail.com>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/lWX8q6MhlCCSTZ6UYrSzWwC5RJQ>
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:46:24 -0000

I have a protocol (Babel) that defines router-id as a base64 string of 8 octets. I could define it as a string, but isn’t it the case that base64 includes only a set of printable characters defined by the regex below? Not all printable characters are included in the set.

> On Aug 17, 2018, at 10:40 AM, Andy Bierman <andy@yumaworks.com> wrote:
> 
> 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 <mailto: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 <mailto:mjethanandani@gmail.com>
> 
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org <mailto:yang-doctors@ietf.org>
> https://www.ietf.org/mailman/listinfo/yang-doctors <https://www.ietf.org/mailman/listinfo/yang-doctors>
> 

Mahesh Jethanandani
mjethanandani@gmail.com