package bcrypt

import (
	"golang.org/x/crypto/bcrypt"
)

func New(b []byte) ([]byte, error) {
	return bcrypt.GenerateFromPassword(b, bcrypt.DefaultCost)
}

func Equal(hashed, plain []byte) bool {
	return bcrypt.CompareHashAndPassword(hashed, plain) == nil
}
