Re: randomness (crypto?) code example wanted please?
"Greg A. Woods" <[email protected]> Tue, 27 Jun 2017 16:23:25 -0700
| Newsgroups | gmane.os.netbsd.devel.crypto,gmane.os.netbsd.devel.userlevel |
|---|---|
| Organization | Planix, Inc. |
| Message-ID | <[email protected]> |
--pgp-sign-Multipart_Tue_Jun_27_16:23:24_2017-1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable At Sun, 25 Jun 2017 15:21:54 +0700, Robert Elz <[email protected]> wrote: Subject: randomness (crypto?) code example wanted please? >=20 > I am (sometime not to far away) planning to add $RANDOM to > the NetBSD shell (for !SMALL shells so not for install media) - part > of keeping up with the Jones's, as just about every other shell has it, > even our /bin/ksh. For what it is worth I've been using the likes of: if [ ${RANDOM:-0} -ne ${RANDOM:-0} ] ; then : is some kind of ksh variant or clone fi since I first encountered ksh, probably in the mid 1980s (I have references to using ksh-85 in my dot files, though my oldest SCCS recorded reference to $RANDOM in my dot files dates back to 1993). I.e. no, not just about every other shell has $RANDOM -- all those that are derivatives of Ash, as well as any AT&T /bin/sh or derivative, still don't have $RANDOM (and many of those without $RANDOM have few other features that can reliably class them as non-ksh-like). Of course I'm not at all opposed to adding $RANDOM to any shell, or indeed to POSIX. I just wanted to point out that this remains reliable to this day so that I can drop my dot files on any system and expect them to work no matter what login shell I've been given. Again for what it's worth I think though that a NetBSD /bin/sh with $RANDOM will probably pass muster as a ksh clone for the few things that matter in my dot files -- I just want to avoid having to invent a new category for it just to keep it separate from both Ksh (and clones) and other Ash derivatives that don't grow a $RANDOM. --=20 Greg A. Woods Planix, Inc. <[email protected]> +1 250 762-7675 http://www.planix.com/ --pgp-sign-Multipart_Tue_Jun_27_16:23:24_2017-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (NetBSD) iEYEABECAAYFAllS6OwACgkQZn1xt3i/9H+H0ACgwf3WaLq6zIjoCLf78Gbh3Gih 2JkAn2P3bDwFiGZMq84mhQfZpLWqKh4L =M1Ix -----END PGP SIGNATURE----- --pgp-sign-Multipart_Tue_Jun_27_16:23:24_2017-1--