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

Fixed $timestamp in hmacAuthorizationToken() #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

garvin
Copy link

@garvin garvin commented Apr 1, 2016

Old timestamp method used time() * 1000 [which on many systems is a float (and only accurate to the second)] & converting that into a string, resulting in incorrect values:

$timestamp = strval(time()*1000); // example: '1.45952654E+12'

New method creates accurate, correct values:

$timestamp = sprintf('%.0f', array_sum(explode(' ', microtime())) * 1000); // example: '1459526540161'

garvin and others added 3 commits September 10, 2015 11:42
Instead of using microtime(true) to generate a millisecond timestamp, switched to a more accurate microtime() method (although for milliseconds, microtime(true) and microtime() methods were always the same in my testing).
Left it off in previous commits and shouldn't have.
@davidadas
Copy link

Probably want to squash.

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

Successfully merging this pull request may close these issues.

2 participants