Skip to content

Commit

Permalink
collections: lowercase instance ID (textileio#318)
Browse files Browse the repository at this point in the history
Signed-off-by: Sander Pick <[email protected]>
  • Loading branch information
sanderpick committed Apr 20, 2020
1 parent d4a95b9 commit f83ed3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package db

import (
"crypto/rand"
"strings"

ds "github.com/ipfs/go-datastore"
format "github.com/ipfs/go-ipld-format"
"github.com/oklog/ulid/v2"
ulid "github.com/oklog/ulid/v2"
)

const (
Expand All @@ -19,7 +20,7 @@ type InstanceID string
// NewInstanceID generates a new identity for an instance.
func NewInstanceID() InstanceID {
id := ulid.MustNew(ulid.Now(), rand.Reader)
return InstanceID(id.String())
return InstanceID(strings.ToLower(id.String()))
}

func (e InstanceID) String() string {
Expand Down

0 comments on commit f83ed3d

Please sign in to comment.