Created
December 25, 2014 14:59
-
-
Save shunsugai/e8b9d7dc30d8be60edd4 to your computer and use it in GitHub Desktop.
Decrypt gesture.key with Golang.
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
package main | |
import ( | |
"fmt" | |
"github.com/kokardy/listing" | |
"runtime" | |
"sync" | |
) | |
func main() { | |
runtime.GOMAXPROCS(runtime.NumCPU()) | |
ss := listing.IntReplacer([]int{0, 1, 2, 3, 4, 5, 6, 7, 8}) | |
repeatable := false | |
buf := 5 | |
wait := new(sync.WaitGroup) | |
for i := 4; i < 10; i++ { | |
wait.Add(1) | |
go func(select_num int) { | |
for perm := range listing.Permutations(ss, select_num, repeatable, buf) { | |
fmt.Println(perm) | |
} | |
wait.Done() | |
}(i) | |
} | |
wait.Wait() | |
} | |
//real 0m11.992s | |
//user 0m23.235s | |
//sys 0m3.609s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment