Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112050 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87893 invoked from network); 13 Oct 2020 17:27:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Oct 2020 17:27:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A19D21804AA; Tue, 13 Oct 2020 09:42:35 -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=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (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; Tue, 13 Oct 2020 09:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602607352; bh=RlhxxxocSqrZd8Z/jDaSwgyI/ddWhKNX5qNfWbjI2Xo=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=PLrZbhz3MHpuwWkGDKBF+k3qiMCdvM2aQGkYtiXEWJ+d1nl3KDuaCcYqSIr/oprfG dtcBelTBugqG07w3IligL9RAxpZBQNAIDofqP7j9le6hgIuDsWNJ/CroSFdvOBUAiG B4FjIxhh/LfA4dPoClL1aDAaaqVix2CG5DAVqlBk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([91.8.169.61]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MhlKs-1jxQHA07hA-00dk62; Tue, 13 Oct 2020 18:42:32 +0200 To: Sara Golemon Cc: Hans Henrik Bergan , PHP internals References: Message-ID: <4267ea59-e9fa-1231-7f4b-46d1204eb291@gmx.de> Date: Tue, 13 Oct 2020 18:42:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:HxIbLqbKU67lSFSOfDUhXQlsPVbFW5O2Ns8J2z76jkLcLBlSRZ8 fEQlYPrJdeO6wxz13IHv4VeaCUS8i/s2j4Z8EC4c2abSWkKobWDo7pwNwwjyyzxJDBVk8vA lXaSOV+r2sYY/Se+7+esm+nRFXu+++T4p9vaWe25Azg5kfvC9pwsQ0AyvA93YPpvoiZQFzU w+B/xIYk8aLR7EM2wsljg== X-UI-Out-Filterresults: notjunk:1;V03:K0:5pn8O9bgHnI=:wLO/yTBfAvKeOLdUNw+wb8 YnrpIenH3fbYO3lhBrIz9YoJS5W2tRORbRsYBNEQfdqf4EsGiWZiMS9wmbgJkj85QaPlkICjE OMyDfOIRSoPG6nmg6zIWC2eb3DA1C9eSRiUmAvnNQLVktnY7QhBFTvfyDmr1IbKWr0oG1PNT9 EH9Dvb+XY8gK7pZ9OI+tEUPuFOxmIRvO5In9lXSTPZs9XzFI9NnzdpC9+OU2nkLLWijZbCzPC 9W1YyjQQbjmUr7LSUrvvn4wCoPQdDK1dR0mmgQZzMrDFaXOmm8Jdg3r3YEyAI09w6d52FLYmp VJe7ryoa6B1UlRMmvGn2Cnr+24x+9Mk6MdVreqUaY9/N4JdATS1BMqM321AfVPuSzPN7cWvO0 L2SrVh90G6r6NFfp2Uk9oOVLoxbCsRzpYf/qbtTrYkNwGfbrpzM9ZErxbbFP1sDJiTnNpJBoN YJz/6rKNOisoGqlpi5ZGtYAPGy5zlsP0YoFjbYk65Q1Z0ckBpSBqHabNSHGItopaRdtIMrmLC HCk7YfovsfrXwirOtaBmwkub4yTo2CrtIMOxlhfEJistiTCT5UvtQoTdDdeH4biZzGcd5hgtN jiXUFyfq+aSbhIjUtq2UpLvkFgJNvtq1n37izVdlUz37/4hEsB0JUTCYZDxaem8Xxq9W8SIz8 thLEbFxf4fZmcLzWfyT3qrdaEd+DwBW9Xc75UdRGoy0kOySnk17cCH2PAAVgRZVP0rsCQp6Ql fXVmHSGdat6LyVqliE0C3zoz1HSVin9qH42betqE20X+pVTsX4LWDxSplkOkUJzHZ39Rj7JTE UvgOnQK10qwxKbzaPKMB/wexgNT+fvCAZAitKUxrkUCwmgJlzl1ZSwe7DIUFVQMPaRHpzbuZF LxvtC15MhzLGJCQ3zu2Q== Subject: Re: [PHP-DEV] Re: want an Object-oriented interface for HashContext From: cmbecker69@gmx.de ("Christoph M. Becker") On 13.10.2020 at 18:01, Sara Golemon wrote: > On Mon, Oct 12, 2020 at 7:55 AM Christoph M. Becker > wrote: >> >> On 12.10.2020 at 13:49, Hans Henrik Bergan wrote: >> >>> something like >>> >>> $result =3D (new > HashContext("SHA1"))->update($str1)->update($str2)->final(); >>> >>> (userland sample imp: https://3v4l.org/lXd3u ) >>> >>> I tried asking on the bugtracker ( https://bugs.php.net/bug.php?id=3D8= 0221 > ) , >>> but was told to ask on this mailing list instead. >> >> Thanks for bringing this up on the mailing list! >> >> I basically very much support a proper OOP interface, but I think the >> method names should use camel-case (e.g. ::updateFile() instead of >> ::update_file()), and it might be appropriate to rename ::final() to >> ::finalize(). More bikeshedding regarding the method names, and maybe >> their signatures might be in order. We do not necessarily have to make >> these methods aliases of the existing functions, although that's of >> course possible. >> > > Ditto all this. When we converted resource to > object I fully intended to propose adding methods on the > context using pretty much exactly the API you describe. Digests lend > themselves quite well to this, tbqh. I did want to separate the tech de= bt > of removing resources from the feature creep of adding an OOP API though= , > and with that release already quite featurefull, plans to expand it fell= by > the wayside. > > Happy to co-author an RFC with you if you'd like to get involved directl= y, > or I can just pick up the ball and run with it if you'd rather make the > feature request then step back. Please go with this, if you like. Note that I didn't make the feature request; I just support it. :) =2D- Christoph M. Becker