Ejemplo n.º 1
0
func New(orgId int64, name string) KeyGen {
	apiKey := ApiKey{}
	apiKey.OrgId = orgId
	apiKey.Name = name
	apiKey.Key, _ = uuid.UUID()
	result := KeyGen{}
	result.HashedKey, _ = EncodePassword(apiKey.Key, name)

	jsonString, _ := json.Marshal(apiKey)

	result.ClientSecret = base64.StdEncoding.EncodeToString([]byte(jsonString))
	return result
}
Ejemplo n.º 2
0
Archivo: main.go Proyecto: patdhlk/uuid
func main() {
	uuid, _ := uuid.UUID() //getting the uuid as a string
	log.Println(uuid)
}