PHP Classes

File: backend/go/database/password.go

Recommend this page to a friend!
  Packages of Everton C B Junior   Igreja Aberta   backend/go/database/password.go   Download  
File: backend/go/database/password.go
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Igreja Aberta
Church activity management application
Author: By
Last change:
Date: 11 days ago
Size: 408 bytes
 

Contents

Class file image Download
package database import "golang.org/x/crypto/bcrypt" func HashPassword(password string) (string, error) { hashed, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) if err != nil { return "", err } return string(hashed), nil } func VerifyPassword(password, hashedPassword string) bool { return bcrypt.CompareHashAndPassword([]byte(hashedPassword), []byte(password)) == nil }