Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharding error #4

Closed
Vonsild opened this issue Mar 31, 2015 · 2 comments
Closed

Sharding error #4

Vonsild opened this issue Mar 31, 2015 · 2 comments
Labels

Comments

@Vonsild
Copy link

Vonsild commented Mar 31, 2015

in UrlBuilder::createURL, line 46 in the file, crc32($path) will often return a negative number, making $this->domains[$index] in line 48 return a blank, resulting in broken URLs

@jacktasia
Copy link
Contributor

Hi Vonsild,

Thanks for the report. It looks like this is a problem with 32-bit systems. It's outlined in the warning text here: http://php.net/manual/en/function.crc32.php.

I pushed a change that will hopefully fix this for you. It's in release 1.0.3.

Please let me know if you continue to have problems. Thanks!

@Vonsild
Copy link
Author

Vonsild commented Apr 1, 2015

Okay, that probably fixes it. May I suggest using

abs(crc32($v))

instead of

intval(sprintf("%u", crc32($v)))

it's faster and simpler :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants