From 5a986d4e817fdd28d963c78246380fd489b137dd Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 11 Sep 2021 18:27:53 +0300 Subject: Removed password hashing obligation --- README.md | 1 - go-src/user.go | 2 -- 2 files changed, 3 deletions(-) diff --git a/README.md b/README.md index 3dfd6a9..0da5b81 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ Each user must have the following properties: - `string Name`: between 2 and 60 characters (A-z, spaces, ', -) Two users can't have the same UserName. Once set, a UserName cannot be changed. -Passwords must be hashed. You decide on which algorithm to use. ### Chat rooms diff --git a/go-src/user.go b/go-src/user.go index 9b49fd1..be01b3e 100644 --- a/go-src/user.go +++ b/go-src/user.go @@ -22,7 +22,6 @@ const ( ) func (u User) ValidatePassword(password string) bool { - // TODO: Implement hashing f, _ := os.ReadFile(folderPaths.FileAtUsersFolder(u.Username)) passHash := bytes.Split(f, []byte("\n"))[1] return string(passHash) == password @@ -64,7 +63,6 @@ func logoutUser() { } func createUser(data []string) { - // TODO: Password hashing f, _ := os.Create(folderPaths.FileAtUsersFolder(data[0])) f.WriteString(data[0] + "\n" + data[1] + "\n" + data[2]) f.Close() -- cgit v1.2.3