Documentation ¶
Overview ¶
Package kagi is a simple Go utility for managing application keys.
It enables the application to generate and use a secure key on production, while allowing the developers to use hardcoded key that can be shared for the whole team during development.
Here is a basic example for this package:
package main import ( "fmt" "github.com/h4ckedneko/kagi" ) func main() { // Generate a new secure key. key := kagi.New(32) fmt.Println(key) // Decode a generated key. keyd := kagi.Decode(key) fmt.Println(string(keyd)) // Decode a hardcoded key. keyd = kagi.Decode("abc123") fmt.Println(string(keyd)) }
See https://github.com/h4ckedneko/kagi/tree/master/examples for more advanced real-world examples.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode decodes an application key and returns its raw bytes. It accepts application key that was generated by New or application key that was manually hardcoded.
func DecodeString ¶ added in v1.0.2
DecodeString is like Decode, but it returns the key as string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.