func (h PBKDF2SHA256) Config() (internal.HashConfig, error) {
	return basicConfig("PBKDF2_SHA256", h.Rounds, InputOrderUnspecified)
}
Config returns the validated hash configuration.
package hash
import (
	"encoding/base64"
	"errors"
	"fmt"
	"firebase.google.com/go/v4/internal"
)
type InputOrderType int
const (
	InputOrderUnspecified InputOrderType = iota
	InputOrderSaltFirst
	InputOrderPasswordFirst
)
type Bcrypt struct{}
func (b Bcrypt) Config() (internal.HashConfig, error) {
	return internal.HashConfig{"hashAlgorithm": "BCRYPT"}, nil
}
type StandardScrypt struct {
	BlockSize        int
	DerivedKeyLength int
	MemoryCost       int
	Parallelization  int
}
func (s StandardScrypt) Config() (internal.HashConfig, error) {
	return internal.HashConfig{
		"hashAlgorithm":   "STANDARD_SCRYPT",
		"dkLen":           s.DerivedKeyLength,
		"blockSize":       s.BlockSize,
		"parallelization": s.Parallelization,
		"memoryCost":      s.MemoryCost,
	}, nil
}
type Scrypt struct {
	Key           []byte
	SaltSeparator []byte
	Rounds        int
	MemoryCost    int
}
func (s Scrypt) Config() (internal.HashConfig, error) {
	if len(s.Key) == 0 {
		return nil, errors.New("signer key not specified")
	}
	if s.Rounds < 1 || s.Rounds > 8 {
		return nil, errors.New("rounds must be between 1 and 8")
	}
	if s.MemoryCost < 1 || s.MemoryCost > 14 {
		return nil, errors.New("memory cost must be between 1 and 14")
	}
	return internal.HashConfig{
		"hashAlgorithm": "SCRYPT",
		"signerKey":     base64.RawURLEncoding.EncodeToString(s.Key),
		"saltSeparator": base64.RawURLEncoding.EncodeToString(s.SaltSeparator),
		"rounds":        s.Rounds,
		"memoryCost":    s.MemoryCost,
	}, nil
}
type HMACMD5 struct {
	Key        []byte
	InputOrder InputOrderType
}
func (h HMACMD5) Config() (internal.HashConfig, error) {
	return hmacConfig("HMAC_MD5", h.Key, h.InputOrder)
}
type HMACSHA1 struct {
	Key        []byte
	InputOrder InputOrderType
}
func (h HMACSHA1) Config() (internal.HashConfig, error) {
	return hmacConfig("HMAC_SHA1", h.Key, h.InputOrder)
}
type HMACSHA256 struct {
	Key        []byte
	InputOrder InputOrderType
}
func (h HMACSHA256) Config() (internal.HashConfig, error) {
	return hmacConfig("HMAC_SHA256", h.Key, h.InputOrder)
}
type HMACSHA512 struct {
	Key        []byte
	InputOrder InputOrderType
}
func (h HMACSHA512) Config() (internal.HashConfig, error) {
	return hmacConfig("HMAC_SHA512", h.Key, h.InputOrder)
}
type MD5 struct {
	Rounds     int
	InputOrder InputOrderType
}
func (h MD5) Config() (internal.HashConfig, error) {
	return basicConfig("MD5", h.Rounds, h.InputOrder)
}
type PBKDF2SHA256 struct {
	Rounds int
}