diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8324d7d..6a9dc70 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,9 @@
-
+
+
-
@@ -86,7 +86,8 @@
-
+
+
true
diff --git a/README.md b/README.md
index 7afcb53..1b878b3 100644
--- a/README.md
+++ b/README.md
@@ -88,6 +88,14 @@ It is recommed to install apg in a directory of your ```$PATH``` environment. To
```sh
$ sudo cp apg /usr/local/bin/apg
```
+
+## Programmatic interface
+Since v0.4.0 the CLI and the main package functionality have been separated from each other, which makes
+it easier to use the `apg-go` package in other Go code as well. This way you can make of the password
+generation in your own code without having to rely on the actual apg-go binary.
+
+Code examples on how to use the package can be found in the [example-code](example-code) directory.
+
## Usage examples
### Default behaviour
By default apg-go will generate 6 passwords, with a minimum length of 12 characters and a
diff --git a/example-code/simple-password-generator/main.go b/example-code/simple-password-generator/main.go
new file mode 100644
index 0000000..cf31235
--- /dev/null
+++ b/example-code/simple-password-generator/main.go
@@ -0,0 +1,27 @@
+package main
+
+import (
+ "fmt"
+ "github.com/wneessen/apg-go/chars"
+ "github.com/wneessen/apg-go/config"
+ "github.com/wneessen/apg-go/random"
+)
+
+func main() {
+ c := config.Config{
+ UseNumber: true,
+ UseSpecial: true,
+ UseUpperCase: true,
+ UseLowerCase: true,
+ PwAlgo: 1,
+ MinPassLen: 15,
+ MaxPassLen: 15,
+ }
+ pl := config.GetPwLengthFromParams(&c)
+ cs := chars.GetRange(&c)
+ pw, err := random.GetChar(&cs, pl)
+ if err != nil {
+ panic(err)
+ }
+ fmt.Println("Your Password:", pw)
+}