Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jackspirou committed Jan 12, 2025
1 parent 0726501 commit bb989ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The `uuidkey` package generates secure, readable API keys by encoding UUIDs usin
```
AGNTSTNP_38QARV01ET0G6Z2CJD9VA2ZZAR0XJJLSO7WBNWY3F_A1B2C3D8
└──────┘ └──────────────────────────┘└───────────┘ └──────┘
Prefix UUID-based identifier Entropy Checksum
Prefix Crock32 Encoded UUID Entropy Checksum
```
### Components
Expand Down Expand Up @@ -80,14 +80,14 @@ import "github.com/agentstation/uuidkey"
```go
// Create a new API Key with default settings (160-bit entropy)
apiKey := uuidkey.NewAPIKey("AGNTSTN", "d1756360-5da0-40df-9926-a76abff5601d")
fmt.Println(apiKey) // Output: AGNTSTN_38QARV01ET0G6Z2CJD9VA2ZZAR0XJJLSO7WBNWY3FQ
fmt.Println(apiKey) // Output: AGNTSTNP_38QARV01ET0G6Z2CJD9VA2ZZAR0XJJLSO7WBNWY3F_A1B2C3D8
// Create an API Key with 128-bit entropy
apiKey = uuidkey.NewAPIKey("AGNTSTN", "d1756360-5da0-40df-9926-a76abff5601d", uuidkey.With128BitEntropy)
fmt.Println(apiKey) // Output: AGNTSTN_38QARV01ET0G6Z2CJD9VA2ZZAR0XJJLSO7W
fmt.Println(apiKey) // Output: AGNTSTNP_38QARV01ET0G6Z2CJD9VA2ZZAR0XJJLSO7WBNWY3F_A1B2C3D8
// Parse an existing API Key
apiKey, err := uuidkey.ParseAPIKey("AGNTSTN_38QARV01ET0G6Z2CJD9VA2ZZAR0XJJLSO7WBNWY3FQ")
apiKey, err := uuidkey.ParseAPIKey("AGNTSTNP_38QARV01ET0G6Z2CJD9VA2ZZAR0XJJLSO7WBNWY3F_A1B2C3D8")
if err != nil {
log.Fatal("Error:", err)
}
Expand Down

0 comments on commit bb989ca

Please sign in to comment.