Pinq\Iterators\Common\Identity::hash PHP Method

hash() public static method

Returns a string representing the supplied value's identity.
public static hash ( mixed $value ) : string
$value mixed
return string
    public static function hash($value)
    {
        $typeIdentifier = gettype($value)[0];
        switch ($typeIdentifier) {
            case 's':
                //string
                return 's' . (strlen($value) > 32 ? md5($value) : $value);
            case 'i':
                //integer
            //integer
            case 'b':
                //boolean
            //boolean
            case 'd':
                //double
            //double
            case 'r':
                //resource
            //resource
            case 'u':
                //unknown type
                return $typeIdentifier . $value;
            case 'N':
                //NULL
                return 'N';
            case 'o':
                //object
                return 'o' . spl_object_hash($value);
            case 'a':
                //array
                return self::arrayHash($value);
        }
    }