示例#1
0
文件: apikey.go 项目: patdhlk/apikey
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
文件: main.go 项目: patdhlk/uuid
func main() {
	uuid, _ := uuid.UUID() //getting the uuid as a string
	log.Println(uuid)
}