Advertisement
Guest User

Untitled

a guest
Sep 28th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. async.until(
  2. function() {return found},
  3. function(callback) {
  4. var hash_array = []
  5. var possible = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM'
  6. for (var i = 0; i <= hash_length - 1; i++) {
  7. var n = (Math.floor(Math.random() * possible.length))
  8. hash_array.push(possible.charAt(n))
  9. }
  10.  
  11. hash = hash_array.join('')
  12.  
  13. cache.get(hash, function(err, res) {
  14.  
  15. if (res == false) {
  16. found = true
  17. }
  18. callback()
  19. })
  20. },
  21. function() {
  22. cb(hash)
  23. }
  24. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement