From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18922 invoked from network); 24 Oct 2022 04:48:24 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Oct 2022 04:48:24 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1666586904; b=OWtJhGAqhoIVcuJlotbLJaavXphKk1WTcMOM2OsJ6OMl1EPqUG9mYn5nrNlv+eTRy1Vidf/15T GSqM48put3qNROJT9C/otTteF2O+alR+XkjRIYDBpYFVe7x/hR+NP9tjwXcz3+ZjXTcZ3FVIaq t7olnIH9blQsJjxnm+Jy/jgiqogG66+RIUwEC795LpYPIsNrHHyZumEZmzGNSUvnByuvBRkyS4 YERkSlfC3aP7ykeB9apVhDPUJSyWPZmWoMWymBT/xw6/jKVkod4GHj7CwI5TbmPtJ1lB9nhqu+ ziwonStYoUTLQGeDZ6YZpWbiOgCC718hSiDTVsJCWfTwPg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f45.google.com) smtp.remote-ip=209.85.208.45; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1666586904; bh=0w6kPqA4aBvf4lqHcb38M5r1+cy51lg9NLVRbvW2FRY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=SIlbESlUv7lYm7IZrYR5iN+jjArnjSX112uWj6w6pCfaOjfyA50Dc/N/unFwHQH/29aHUqdKUi XuVLotZgc5XZEDBGracz4DbVEz+AzGOo7/33t7jFlh6NRDo3MQ+33HvGLnpr2kr9ZU5kLwHSfA SbIaFA2p+ONuZOaIX0dpg/GexDm8ypI+ZqsncwYEo7IPQLdLVpZnhlCuv2B1IAzjXHxNYaunwN hqnpu+rj/oZ+6HafLeoOX7jbcgaI1QZgexzjgdhlxp9rpotjN1OO/R4R8tkexNnieRgT51qxxi gY1JKOYtwrv98NkQU9Hcfv3A3HSxXru3wlwUIVRrQSjEgg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Nzscj+Q68X08VcMnn4X8f79sfIsDrPSg98ATNQXomAw=; b=CSwUJqX2Ev5mj2qrphHGKLn6k2 h6dZpCMvmjO/GmiqdKkmY601fdRyaSTsL9OK1HMk18ZFFz4lOdBF4VuY0SL9+lmrR9ipIt9Idnfju WgIk1X1CAW4Qr68h567Zim3CuewZnyKlY3NrnfPMM0CIQQySJCJV2+GWNkfhDRFzegObrJC4x5lUB DM+n5QOjQMH0wT9wEW9PBL2Nixopz2KDWj1Y38RDnOETEdSOiWr6kwyeEjV7ocwius3CG1lNfg03A VNDufq6TolyCS+LqwWuFZUZMpocK29Ovy6JQ0xPDWKBtayC3SbbWYW6FfRN89EKsLZjWpls1EGRL+ Hyl0odUQ==; Received: by zero.zsh.org with local id 1ompNv-000CcD-3P; Mon, 24 Oct 2022 04:48:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f45.google.com) smtp.remote-ip=209.85.208.45; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f45.google.com ([209.85.208.45]:35820) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ompNN-000CI8-LJ; Mon, 24 Oct 2022 04:47:50 +0000 Received: by mail-ed1-f45.google.com with SMTP id t18so11345825edt.2 for ; Sun, 23 Oct 2022 21:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Nzscj+Q68X08VcMnn4X8f79sfIsDrPSg98ATNQXomAw=; b=oH2hVNCSxh2G1574FkyhSuZ78bla4uvwTfiRW9TdjCyIMxnO3K1G+vrv9ymodMhJsF lmrAK4bK9BUKx4GUJXzBPhJdkoDADahoTrcHwJt4L8aetOx5kd8RuJR8iFrqhns3PRon d8mAG/j8kl4q7u+bLFrPQ5OSpFg9gmsdcqCTgA9vZd/TFNEOVIpGdb2g18DFzfbrp0Xs IJ4lMA9eRlAKshZkCQq8n8s3f/LtkiNzZerNc15MJHNpG71c9XbxQeAG8DHHAMxDqRVv 4jaTC8zHse++QaWeSnqcvKh7g16p5mERlytctuHg/FPF725kFgXidlRMU2RyDpvwNe3W zs8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Nzscj+Q68X08VcMnn4X8f79sfIsDrPSg98ATNQXomAw=; b=c3RGuca2T7CumYtDMreS73hsPjyuzcjiartEH0uRkxC4gmWnmLU92xK+xnxHoIlaet WN7GaaHlJ29L52owNmUS+rWgoNvBLmYHn1ImLroxgqdnEo5mbcI55CZy1P1JMlAoDzpr a1rX4o0Y8h5lapRORnRNOhT05TZzSUe3SrZ4G96gvYwi44w1kWhKgfXr1yPq8+F1hXR3 zHKrL3PoDChqAxj8MMljGHt5uWkOhLylqz9akwhXlhkkK3qFAAmrAyEUZx5z8ANCSUGh K3xHcI5JW6AGmiMQ52Lyeki7MRI49WsVqEUOc7Ji41qJz/d8pJJ1UhP7b+6Ivhsm1xXP Rx3Q== X-Gm-Message-State: ACrzQf1TpTtSy3tEYjf1WH/rH8EG0H/GMPUHLAluB2HzHt6lo0MJR9p4 0vX5vuYxhneNkwsuj43U9Ih7GYYR+sVi2GR8Z+maMMMFoof8GA== X-Google-Smtp-Source: AMsMyM4iBiYCQcSU5bpTiD4a6kEbcueo5T2V2yqiWQ358onZtI8FmV3+61uKbMOQ+kMuYbIQl4dO9aW41ZOEraMTzjU= X-Received: by 2002:aa7:df16:0:b0:45b:f51f:ab73 with SMTP id c22-20020aa7df16000000b0045bf51fab73mr29146969edy.366.1666586868941; Sun, 23 Oct 2022 21:47:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sun, 23 Oct 2022 21:47:37 -0700 Message-ID: Subject: Re: preliminary patch for zsh/random module To: Clinton Bunch Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 50830 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Sun, Oct 23, 2022 at 7:57 PM Clinton Bunch wrote: > > On 10/23/2022 9:01 PM, Bart Schaefer wrote: > > * Typo in the introductory comment. > I'm pretty sure I've since found and changed all the instances of > Zoltan's name. I was referring to the spelling of "randome". > > Actual question: What's the use case for returning or printing a > > block of random bytes? Why does this need to be a builtin? > Mostly because I see constructs like read -k6 -u3 3 it would be nice to initialize an array with random numbers without > having to use a loop to access SRANDOM n times. But you're not filling an array with random numbers, you're filling a string (scalar) with random bytes. > > Suggestion: Treat SRANDOM like SECONDS, in that you can change the > > type from integer to floating-point. Then maybe the zrandom() math > > function isn't needed? > That would seem confusing to me, and too easy to forget which state you > left it in. You make it local so you're not leaving it. () { print $SECONDS; () { local -F SECONDS print $SECONDS } print $SECONDS } 56 0.0000050000 56 > zrandom was meant to be a replacement for rand48 OK.