Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66026 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44237 invoked from network); 20 Feb 2013 08:25:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2013 08:25:38 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.21 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.21 smtp1.ist.utl.pt Linux 2.6 Received: from [193.136.128.21] ([193.136.128.21:58915] helo=smtp1.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/F3-19387-08884215 for ; Wed, 20 Feb 2013 03:25:37 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.ist.utl.pt (Postfix) with ESMTP id 5739F700044E; Wed, 20 Feb 2013 08:25:33 +0000 (WET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp1.ist.utl.pt ([127.0.0.1]) by localhost (smtp1.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id BG9jxpPUP7ay; Wed, 20 Feb 2013 08:25:33 +0000 (WET) Received: from nebm.ist.utl.pt (unknown [IPv6:2001:690:2100:4::58:1]) by smtp1.ist.utl.pt (Postfix) with ESMTP id 0A4D87000427; Wed, 20 Feb 2013 08:25:33 +0000 (WET) Received: from localhost ([127.0.0.1] helo=nebm.ist.utl.pt) by nebm.ist.utl.pt with esmtp (Exim 4.72) (envelope-from ) id 1U84zc-0004LL-UV; Wed, 20 Feb 2013 08:25:33 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 20 Feb 2013 09:25:32 +0100 To: , Organization: =?UTF-8?Q?N=C3=BAcleo_de_Engenharia_Biom=C3=A9dica_do_Insti?= =?UTF-8?Q?tuto_Superior_T=C3=A9cnico?= In-Reply-To: References: Message-ID: <8776954c4aac08ae337c130e18e89e24@nebm.ist.utl.pt> X-Sender: glopes@nebm.ist.utl.pt User-Agent: RoundCube Webmail/0.8-rc Subject: Re: [PHP-DEV] Question on hash api From: glopes@nebm.ist.utl.pt (Gustavo Lopes) Em 2013-02-20 8:09, Tjerk Anne Meesters escreveu: > Hi, > > I've forked out an interesting project on Github that implements > XXHash and > extended it to work with the hash() function family. Project links > below. > > The integration is pretty straightforward, but the following code had > me > concerned: > > PHP_HASH_API void PHP_XXH32Update(PHP_XXH32_CTX *context, const > unsigned > char *input, unsigned int inputLen) > { > XXH32_feed(context->state, (void *)input, (int)inputLen); > } > > The XXH32_feed() takes an int argument, whereas the update ops > function > takes an unsigned int for the input length. > > Would that ever give a problem? If so, what kind of workaround am I > looking > at? > Not unless and unsigned int with a value larger than INT_MAX is passed. I took a quick look at the calls to ->hash_update and the largest value potentially passed seems to be from a PHP string (via php_hash_hmac_round), which has an int for the length and therefore is not a problem. -- Gustavo Lopes