Advertisement
kiwiboi

hmac

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