Advertisement
kiwiboi

node js hmac

Jul 29th, 2013
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. var crypto = require('crypto');
  2.  
  3. var server_seed = 'ycspKWP0Rn3fm.bCmUdhpv88izrBGNC4.CAVPULqDYTR8s8VVmqcwoMcrHCY28lX3';
  4. var client_seed = '0755766871111';
  5. var nonce = 1;
  6. var count = 1;
  7.  
  8. while (true) {
  9. var hash = crypto.createHmac('sha512', server_seed).update(client_seed + ':' + nonce.toString()).digest('hex').substring(0, 2);
  10. if (hash == '00') {
  11. console.log(' 0', nonce);
  12. if (count++ == 1e3) break;
  13. } else if (hash == 'ff') {
  14. console.log(' 1', nonce);
  15. if (count++ == 1e3) break;
  16. }
  17.  
  18. nonce++;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement