Skip to content

Encrypt a UUID (common use case as tracking cookie)

License

Notifications You must be signed in to change notification settings

FlxOne/golang-encrypted-uuid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golang-encrypted-uuid Build status

Encrypt a UUID (common use case as tracking cookie)

Example: creating

generator := enc_uuid.New([]byte("mysecret90123456"), true)
u := generator.New()
log.Println(u.ToString()) // Encrypted string

Example: reading

generator := enc_uuid.New([]byte("mysecret90123456"), true)
parsed, _ := generator.Parse("T5LvxuSpeC0g2VglOnOACOzuFP0wmH04l49fQmSWR5+kpIXvGXzO0g==")
parsedStr, _ := parsed.UuidStr(generator)
log.Println(parsedStr) // Decrypted hex string representation of the uuid v4

About

Encrypt a UUID (common use case as tracking cookie)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%