// MustNewEncryptor creates a new encryptor or panic
MustNewEncryptor creates a new encryptor or panic
// MustNewEncryptor creates a new encryptor or panic
func MustNewEncryptor() Encryptor {
	var encryptor Encryptor
	switch config.ENV.EncryptorName {
	case encryptorSecretbox:
		keys := [][32]byte{}
		for _, k := range config.ENV.EncryptorSecretboxKeys {
			var b [32]byte
			copy(b[:], []byte(k))
			keys = append(keys, b)
		}
		encryptor = &SecretboxEncryptor{
			keys:          keys,
			base64Enabled: true,
		}
	default:
		panic(fmt.Sprintf("unknown encryptor name: %s", config.ENV.EncryptorName))
	}
	return encryptor
}
func MustNewEncryptor ( ) Encryptor { var encryptor Encryptor switch config . ENV . EncryptorName { case encryptorSecretbox : keys := [ ] [ 32 ] byte { } for _ , k := range config . ENV . EncryptorSecretboxKeys { var b [ 32 ] byte copy ( b [ : ] , [ ] byte ( k ) ) keys = append ( keys , b ) } encryptor = & SecretboxEncryptor { keys : keys , base64Enabled : true , } default : panic ( fmt . Sprintf ( " " , config . ENV . EncryptorName ) ) } return encryptor }
MustNewEncryptor creates a new encryptor or panic
MustNewEncryptor creates a new encryptor or panic