Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114515 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 16404 invoked from network); 18 May 2021 17:20:22 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 May 2021 17:20:22 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3D9291804B5 for ; Tue, 18 May 2021 10:29:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 18 May 2021 10:29:55 -0700 (PDT) Received: by mail-qt1-f174.google.com with SMTP id 1so8099826qtb.0 for ; Tue, 18 May 2021 10:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ma4+sCzuzFqik7Y1gQvnAe/kI/Tf/xulpE8tfMQgViM=; b=PsXPwxlqotFNjeD7qmx208v/6dBBM/3AHQkzL/xZslQBDvsOtxJZkXxG3iN8ZBgs2T 7fQVkz5kcdXHnytKRvfABAUcJGQVYqC2jnhVP9Al2iqLOTXLjZhaeH9nN72BOzfZGZwU O2hAOAwr3eh0dLwk4PFAlIZ/b3aviBzlcDiJbW5eT4Y9jwnIeszbCQVCq+AlzCNlQ6ep 4fmuBbMvMeGhU8Vtn1bzUocmUa49xpianJcV7bA3ay/B2OfoegJUh8kAF+pzpGhdcuXx V0d5JCTZoDNpK44NS6ps1OQ9Bg0PrS4w2kkhmeR4b7YH/q+ccOON10yxT6iVdhjax1JZ XRNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ma4+sCzuzFqik7Y1gQvnAe/kI/Tf/xulpE8tfMQgViM=; b=lQeEyX9g3BMKnLqDbC1f0tD8HeMhyMU68y5Gd+BiZgk8OF/WiCVmUVUq1svfp2mUPR T2y1+dMhGbWCHG7C7Oe5uXGsxNmy/But0pwNXJeG1BleNw0MgDYDk/LwzzCNkiR8i28/ x9+Y4rNh+AEKq4gFyqv8XeRo+qfPNATvGbyqquVugIgtxmkXbAL+5ntY0C2kRrtV5UoY 12UW1u0VgC3gd7SJq1Leuf44Dv83impboM9D3kUqGmkHTZNl7rtXjFaxrEa5hJw+yssY tWeHkU2b36qrswqhLptC6JNYcoWQt2NsWEOj/ZhAgTbidT1fNbvQMnRKwjAVQF9tui2t U8Eg== X-Gm-Message-State: AOAM5303FH7Tf4YcyT5lekXxnSAFFKbnPRQksv2lZpL9zOILCwixvjmU Qa2QknkrwYv0uK8R42IG8FiClyJ/0ccVkh5TByU= X-Google-Smtp-Source: ABdhPJwYBRymao9tJQSytC5M2lqJmMgMKs9oFQU34ylEMu9hpmIPRvIfVOd7EWYkt/h7I43OPAJmX0J64oDygsFbKTI= X-Received: by 2002:ac8:5d01:: with SMTP id f1mr5900478qtx.105.1621358991725; Tue, 18 May 2021 10:29:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 18 May 2021 18:29:41 +0100 Message-ID: To: Go Kudo Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000c1577405c29e0e42" Subject: Re: [PHP-DEV] [RFC] [Draft] Add RNG extension and deprecate mt_srand() From: tekiela246@gmail.com (Kamil Tekiela) --000000000000c1577405c29e0e42 Content-Type: text/plain; charset="UTF-8" Hi Go Kudo, I think this proposal is much better than the one before. I believe we need such functionality in PHP. I have some questions I would like you to consider: 1. I'm still not a fan of exposing the algorithms as separate classes in PHP. Their names are confusing and I don't see how exposing them gives any benefits. I would prefer that, like in password_hash, let the user chose the algorithm using a constant then ask for seed as a second argument to Randomizer. 2. Why is there a getter on Randomizer for the source? 3. Why is the interface called source? 4. You have generateInt() twice. Wouldn't it be better to have it only once but make the arguments nullable or provide PHP_MIN_INT and PHP_MAX_INT as defaults? 5. Why do we need to deprecate the old functions now? What's the rush? Regards, Kamil --000000000000c1577405c29e0e42--