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=-7.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19857 invoked from network); 11 Oct 2022 12:51:23 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2022 12:51:23 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665492683; b=kplHVF+Vp51dp2wDE5gRi7lIosYnF15dU9GkrqwN3r7UUwaoccBzWdOBUkRckm10CmmabuUJ9r 0VDLlBLnDFMgK2ZlOlBd2HfYGOFs+TIG9DRIcbwZ7mwgU9ZGtrW9TWiDssy6BeQuNWkgjVUXmS IfayOKe2rrmGWj+WFX20mwEVNIYKBUrv3rqyf05JajjRj9yztcStQUmMT7StMoS2EmSJp77+li OolA+pJHlTagRmjPdg7FAFc0h0JOOGLSryiEBKj4jNiRUAO/OfTNYkYugrX7Fli63KOcBLD+nQ 6EYR5g7fpWDMBlRU3F/WiYdRAvHVhXUl5yqLEVu71Uw2+A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1665492683; bh=1LKdw0F/OrLgoQZPg8O0W21/pPTS99kTsa1f4o2SxeE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature; b=Sj2o/ZlzbabcFn8pCn5xniTGqVlYyflhD1pRg8ohp/+CQ4QyAq9FEYwH8syhwmYXVo1uthUiez j9rDmBMsdGt4HUtoB0A2kwpom0BDaMCJjc8pT3xjVmr0SreDC2yODDBZCDcqJNtWMrJRBw/BGP 23Au1eI0AE4ZUZ2E/2r92B0d0YllInwc3IiEahkxFqpOZeBipDs8iYADqwrqZTHOfz11dpILIU O1dQA/KvKJtXc0TCmWlNU1aO/GcW2I3MQuTYoTVqS2hOCq1MWJJPvbGajVyPdVz0cPD3sWquJA ddXZcRr5GI5j6EHRH8EefOEMlbPpNkHZ2bPmorF00d6E8A==; 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-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=3soaWKhv4roHI06j3+FoccY7CbsKcz+wTUsqZwMJoB4=; b=PPxrXd1OClveIqeyz4CetUWOhH mDw3GSsAfUEx17fENttMNnZsFBrwohlyZH5hd+igkLaCKk02WsRPoxOnJSzcUE8vVK5ISKfsv92iN zdq2CuG84773Y1Rm9MMA7wPwfJZIZ3+P0gEUTUwYNQ80SBYMtZYPIg3q1IzKOxLZYcEHDH4Z4g2LO Mrt+JCBaa9unL/EEnp2PohKWPLb+uKTyQnanU4dZ1efimDTzTIYWNA1apIOLX/CZCga7ssFv4akHw ZJRF7VtorBlrk/w8syQIXjMMepoSRrFSlgD1cDvyxFYZtI1w8TP/FTJM4XT30BD9Kd718z86Y7+rp kwvwRX3Q==; Received: by zero.zsh.org with local id 1oiEjD-000CJc-Aq; Tue, 11 Oct 2022 12:51:23 +0000 Authentication-Results: zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none Received: from iris.zentaur.org ([198.58.127.206]:44814) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1oiEiz-000Bxz-A2; Tue, 11 Oct 2022 12:51:10 +0000 Received: from iris.zentaur.org (localhost [127.0.0.1]) by iris.zentaur.org (Postfix) with ESMTP id 4Mmwd82Jffz3wZj for ; Tue, 11 Oct 2022 12:51:08 +0000 (UTC) Authentication-Results: iris.zentaur.org (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=zentaur.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zentaur.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:references:to:content-language:subject:subject :user-agent:mime-version:date:date:message-id; s=dkim20200120; t=1665492667; x=1665496268; bh=1LKdw0F/OrLgoQZPg8O0W21/pPTS99kT sa1f4o2SxeE=; b=pqw9Yko5dO7vW0ux7NcUEfvPDhWUA42KvvlHf/dZli9FStgb CjyQlTbGpcfI0gGyj65IdRFwblgs1zSMEYYbP/iMNv5bUDOrMspy24oiQD62m6cy gA1/ofk49NrE3yJDzH0eT5wrRIulQQRZhRuceE5DjR5pTn6kStXrNKoDPMIaN82f mepiLezvpkDM39c9rl2jK3bl+1r17zJTdTyitksl3sDxtBRBqhmw7lQKMTHvL0xw cfUgGY73ZEx3XrYBgA+nwSwWqQHyRdrmeXCVR2rPc08bLQgKNZShGrbKYKQrh1Se A58wDsvVksv4oo49Z9RoGf5ZXtXTdx+Wthb1oQ== X-Virus-Scanned: amavisd-new at iris.zentaur.org Received: from iris.zentaur.org ([127.0.0.1]) by iris.zentaur.org (iris.zentaur.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ze1qwKJ4ByUM for ; Tue, 11 Oct 2022 12:51:07 +0000 (UTC) Received: from [192.168.72.136] (unknown [136.50.213.220]) by iris.zentaur.org (Postfix) with ESMTPSA id 4Mmwd74qjYz3wZb for ; Tue, 11 Oct 2022 12:51:07 +0000 (UTC) Message-ID: <81965a4f-fff9-5a14-fac1-784ac46a6667@zentaur.org> Date: Tue, 11 Oct 2022 07:51:07 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: use of rand() in zsh Content-Language: en-US To: zsh-workers@zsh.org References: <473d6200-de7e-05b0-8ec1-cd49c4258cf8@zentaur.org> From: Clinton Bunch In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: Avast (VPS 221010-10, 10/10/2022), Outbound message X-Antivirus-Status: Clean X-Seq: 50779 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 10/11/2022 1:31 AM, Roman Perepelitsa wrote: > > I would use it, and I think most uses of $RANDOM would be better off > as $SRANDOM. > > In the meantime I'm using this: > https://gist.github.com/romkatv/a6cede40714ec77d4da73605c5ddb36a > > Roman. > The question then is how should it be implemented: 1. Implement a shopt that changed the behavior of RANDOM (Pleasing because of the elegance of using RANDOM for good random values, but probably too confusing) 2. Simply implement a new parameter called SRANDOM (simplest, but change to core zsh interface) 3. Write a module (e.g. zsh/random) that introduced a new special parameter when loaded (more complicated, but isolated to those who want it and possible to fail on systems that don't have a kernel entropy pool)