apg-go/example-code/simple-password-generator/main.go
Winni Neessen c0588f952a
Add SPDX license identifiers to main.go
The identifiers include the FileCopyrightText for the years 2021-2024 attributed to Winni Neessen, and the License to be under MIT. This addition brings the file into compliance with licensing standards.
2024-03-14 09:56:38 +01:00

23 lines
503 B
Go

// SPDX-FileCopyrightText: 2021-2024 Winni Neessen <wn@neessen.dev>
//
// SPDX-License-Identifier: MIT
package main
import (
"fmt"
"github.com/wneessen/apg-go"
)
func main() {
config := apg.NewConfig(apg.WithAlgorithm(apg.AlgoRandom),
apg.WithModeMask(apg.ModeSpecial|apg.ModeNumeric|apg.ModeLowerCase|apg.ModeUpperCase),
apg.WithFixedLength(15))
generator := apg.New(config)
password, err := generator.Generate()
if err != nil {
panic(err)
}
fmt.Println("Your password:", password)
}