connected remotegameprivate and backend

This commit is contained in:
2023-02-24 15:41:40 +00:00
parent 574317d286
commit 0fadadee2d
24 changed files with 2101 additions and 151 deletions

16
server/auth/auth.go Normal file
View File

@@ -0,0 +1,16 @@
package auth
import (
"crypto/sha256"
)
// HashPassword Hash password passed through the
// parameter
func HashPassword(Password string) (string, error) {
data := []byte(Password)
hash := sha256.Sum256(data)
// returning hash as a string
return string(hash[:]), nil
}

17
server/auth/auth_test.go Normal file
View File

@@ -0,0 +1,17 @@
package auth
import (
"fmt"
"testing"
)
// Function to test if the password is hashed
func TestHashPassword(t *testing.T) {
Password, err := HashPassword("AKILAN1999")
if err != nil {
fmt.Println(err)
t.Fail()
}
fmt.Println("Password Hash")
fmt.Println(Password)
}