Comments (2)
Thanks for the report! This issue goes all the way back to the initial libtwitcurl code I based this library on. For some reason, they used rand() % 1000 as part of the nonce. At the rate you're describing, that gives about a 1/167 chance of repeated values since any nonce generated within the span of 1 second only has 1000 possible values.
The fix I just committed should address this for any reasonable rate (it just drops the % operation, using the full value from rand()). Depending on your use case, this could present other issues (since srand() is called once, your nonces may become predictable). Let me know if you continue to run into this issue or if you think a different solution would be better.
from liboauthcpp.
Issue is completely fixed, thanks!
I saw this "rand() % 1000" in code but didn't understand for what it. Now I understand, it was by historical reason. I agree with you this mod not needed now.
from liboauthcpp.
Related Issues (16)
- doesn't work with imgur HOT 1
- segfault for too long urls HOT 1
- MinGW/MSYS compilation fails due to wrong compiler parameters being set
- CMake does not build an x64 version of the lib HOT 2
- Beautiful library! HOT 2
- Problem with two parameters with same name HOT 2
- Tumblr returns 'oauth_signature does not match expected value' on requesting a token HOT 1
- Some suggested fixes for compiling x64 version in Visual Studio 2013
- Can we upgrade to OAuth2 please HOT 1
- Compile warning character constant too long
- liboauthcpp.cpp bool Client::getSignature(..., bool do_urlencode) HOT 4
- My John Deere Api does not accept authorization request
- how to use simple_auth and simple_request
- Duplicate oauth_nonce timestamps on fast requests HOT 1
- Chars to exclude from percent encoding HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liboauthcpp.