From 663abcdcf1402dcb04eb8662b80efb297838cb45 Mon Sep 17 00:00:00 2001 From: yuqing Date: Wed, 28 Jan 2015 19:11:24 +0800 Subject: [PATCH] php ext return unsigned hash code --- HISTORY | 2 +- php-fastcommon/fastcommon.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HISTORY b/HISTORY index 0412874..fb0a796 100644 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,5 @@ -Version 1.13 2015-01-22 +Version 1.13 2015-01-28 * support php extension * php extention export simple_hash and time33_hash diff --git a/php-fastcommon/fastcommon.c b/php-fastcommon/fastcommon.c index b21616a..692967d 100644 --- a/php-fastcommon/fastcommon.c +++ b/php-fastcommon/fastcommon.c @@ -207,7 +207,7 @@ ZEND_FUNCTION(fastcommon_time33_hash) RETURN_BOOL(false); } - RETURN_LONG(Time33Hash(str, str_len)); + RETURN_LONG(Time33Hash(str, str_len) & 0x7FFFFFFF); } /* @@ -237,6 +237,6 @@ ZEND_FUNCTION(fastcommon_simple_hash) RETURN_BOOL(false); } - RETURN_LONG(simple_hash(str, str_len)); + RETURN_LONG(simple_hash(str, str_len) & 0x7FFFFFFF); }