Created
February 27, 2015 08:30
-
-
Save zackexplosion/cbde040e74f0232e6423 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var base = 'http://www.fighter.com.tw/updata/down_files/'; | |
var patterns = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(''); | |
// var patterns = "ABC".split(''); | |
var password_length = 2; | |
var level = 0; | |
var total_length = Math.pow(patterns.length , password_length); | |
console.log('total combine is : ' + total_length); | |
for (var i = 1; i <= total_length; i++) { | |
var pwd = ''; | |
var index = i - 1 ; | |
var point = []; | |
var point = level.toString() + ',' + (index % patterns.length).toString(); | |
point = point.split(','); | |
// console.log(point); | |
if( i % patterns.length === 0 ){ | |
level++; | |
} | |
// point | |
point.forEach(function(element, index){ | |
var key = parseInt(element); | |
pwd += patterns[key]; | |
}); | |
console.log(pwd); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment