mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 20:54:02 +03:00
Direct proxy works
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
|
||||
"github.com/9seconds/mtg/config"
|
||||
)
|
||||
|
||||
func Generate(secretType string) {
|
||||
data := make([]byte, config.SimpleSecretLength)
|
||||
if _, err := rand.Read(data); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
secret := hex.EncodeToString(data)
|
||||
|
||||
switch secretType {
|
||||
case "simple":
|
||||
PrintStdout(secret)
|
||||
case "secured":
|
||||
PrintStdout("dd" + secret)
|
||||
default:
|
||||
Fatal("Unknown secret type " + secret)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user