diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2021-08-30 20:08:51 -0600 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2021-08-30 20:44:45 -0600 |
commit | 9343d2ea697f13e52e9199fce62a959f1954f580 (patch) | |
tree | e1e36e330a3c9891bfd8a625229a9b417ad89afa /srv/chat/user.go | |
parent | 3e9a17abb9a9d63af3c260fba9dc404dd9c59ade (diff) |
add chat handlers and only allow POST methods
Diffstat (limited to 'srv/chat/user.go')
-rw-r--r-- | srv/chat/user.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/srv/chat/user.go b/srv/chat/user.go index 1279a45..3f5ab95 100644 --- a/srv/chat/user.go +++ b/srv/chat/user.go @@ -38,8 +38,8 @@ type UserIDCalculator struct { } // NewUserIDCalculator returns a UserIDCalculator with sane defaults. -func NewUserIDCalculator(secret []byte) UserIDCalculator { - return UserIDCalculator{ +func NewUserIDCalculator(secret []byte) *UserIDCalculator { + return &UserIDCalculator{ Secret: secret, TimeCost: 15, MemoryCost: 128 * 1024, @@ -50,7 +50,7 @@ func NewUserIDCalculator(secret []byte) UserIDCalculator { } // Calculate accepts a name and password and returns the calculated UserID. -func (c UserIDCalculator) Calculate(name, password string) UserID { +func (c *UserIDCalculator) Calculate(name, password string) UserID { input := fmt.Sprintf("%q:%q", name, password) |