func (c Crypt) Available() bool {
	return c > 0 && c < maxCrypt && crypts[c] != nil
}
Available reports whether the Crypt c is available.
package crypt
import (
	"errors"
	"strings"
	"github.com/GehirnInc/crypt/common"
)
var ErrKeyMismatch = errors.New("hashed value is not the hash of the given password")
type Crypter interface {
	Generate(key, salt []byte) (string, error)
	Verify(hashedKey string, key []byte) error
	Cost(hashedKey string) (int, error)
	SetSalt(salt common.Salt)
}
type Crypt uint
const (
	APR1   Crypt = 1 + iota  
	MD5                      
	SHA256                   
	SHA512                   
	maxCrypt
)
var crypts = make([]func() Crypter, maxCrypt)
func (c Crypt) New() Crypter {
	if c > 0 && c < maxCrypt {
		f := crypts[c]
		if f != nil {
			return f()
		}
	}
	panic("crypt: requested crypt function is unavailable")
}