Skip to content

Instantly share code, notes, and snippets.

@abtris
Last active September 17, 2018 19:17
Show Gist options
  • Select an option

  • Save abtris/e6c2cdfdabd031a0cc7a09f618bff351 to your computer and use it in GitHub Desktop.

Select an option

Save abtris/e6c2cdfdabd031a0cc7a09f618bff351 to your computer and use it in GitHub Desktop.
Passwords for drones generation
package main
import (
"fmt"
"math/rand"
)
func main() {
NatoCodes := []string{
"Alfa",
"Bravo",
"Charlie",
"Delta",
"Echo",
"Foxtrot",
"Golf",
"Hotel",
"India",
"Juliett",
"Kilo",
"Lima",
"Mike",
"November",
"Oscar",
"Papa",
"Quebec",
"Romeo",
"Sierra",
"Tango",
"Uniform",
"Victor",
"Whiskey",
"X-ray",
"Yankee",
"Zulu",
}
passPhrase := "webexpo"
for _, value := range NatoCodes {
v := fmt.Sprintf("%04.f", rand.Float64()*10000)
fmt.Printf("%s;%s%v\n", value, passPhrase, v)
}
}
const natoCodes = [
"Alfa",
"Bravo",
"Charlie",
"Delta",
"Echo",
"Foxtrot",
"Golf",
"Hotel",
"India",
"Juliett",
"Kilo",
"Lima",
"Mike",
"November",
"Oscar",
"Papa",
"Quebec",
"Romeo",
"Sierra",
"Tango",
"Uniform",
"Victor",
"Whiskey",
"X-ray",
"Yankee",
"Zulu",
];
const passPhrase = "webexpo";
const passLength = passPhrase.length + 4;
natoCodes.forEach(value => {
pass = passPhrase + Math.round(Math.random()*100000);
console.log(value + ';' + pass.slice(0, passLength));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment