Example #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
}
Example #2
0
File: main.go Project: patdhlk/uuid
func main() {
	uuid, _ := uuid.UUID() //getting the uuid as a string
	log.Println(uuid)
}