A Base32-Crockford encoded API Key generator, validator and converter to turn UUIDs into human readable API Keys for Golang.
You can install this with go get.
go get "github.com/siesgstarena/uuidapikey"
package main
import (
"fmt"
"github.com/siesgstarena/uuidapikey"
)
func main() {
fmt.Println(uuidapikey.Create())
}
Output:
{ "apiKey":"38QARV0-1ET0G6Z-2CJD9VA-2ZZAR0X",
"uuid":"d1756360-5da0-40df-9926-a76abff5601d" }
uuidString := "d1756360-5da0-40df-9926-a76abff5601d"
fmt.Println(uuidapikey.IsUUID(uuidString)) // returns true
apiKeyString := "38QARV0-1ET0G6Z-2CJD9VA-2ZZAR0X"
fmt.Println(uuidapikey.IsAPIKey(apiKeyString)) // returns true
uuidString := "d1756360-5da0-40df-9926-a76abff5601d"
fmt.Println(uuidapikey.ToAPIKey(uuidString))
Output:
38QARV0-1ET0G6Z-2CJD9VA-2ZZAR0X
apiKeyString := "38QARV0-1ET0G6Z-2CJD9VA-2ZZAR0X"
fmt.Println(uuidapikey.ToUUID(apiKeyString))
Output:
d1756360-5da0-40df-9926-a76abff5601d
Currently, Issue Tracking is done via GitHub Issues.