for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* This file is part of Esi\ConsistentHash.
*
* (c) Eric Sizemore <[email protected]>
* (c) Paul Annesley <[email protected]>
* This source file is subject to the MIT license. For the full copyright and
* license information, please view the LICENSE file that was distributed with
* this source code.
*/
namespace Esi\ConsistentHash\Hasher;
* Uses CRC32 to hash a value into a signed 32bit int address space.
* Under 32bit PHP this (safely) overflows into negatives ints.
class Crc32Hasher implements HasherInterface
{
public function hash(string $string): int
return crc32($string);
}