Пример #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
}
Пример #2
0
func main() {
	uuid, _ := uuid.UUID() //getting the uuid as a string
	log.Println(uuid)
}