Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 660 Bytes

README.md

File metadata and controls

17 lines (15 loc) · 660 Bytes

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