Generate oAuth nonce for parallel requests

后端 未结 3 1151
生来不讨喜
生来不讨喜 2021-01-21 09:12

I am requesting Bitstamp API in parrallel:

// Simplified version

var async = require(\'async\');
var bitstamp = require(\'bitstamp\');

async.parallel([
    bit         


        
3条回答
  •  迷失自我
    2021-01-21 09:52

    (author of the npm module here)

    I solved it by adding my own counter at the end of the ms timestamp. It now supports up to 999 calls per ms because of this function. The first time it will generate something like 1409074885767000 and if you need a new nonce during the same ms it will then generate 1409074885767001, 1409074885767002, ...

提交回复
热议问题