func CreateCrypter(f *FormattingOptions) (*Crypter, error) {
	h, err := hashing.CreateHashFunc(f)
	if err != nil {
		return nil, errors.Wrap(err, "unable to create hash")
	}

	e, err := encryption.CreateEncryptor(f)
	if err != nil {
		return nil, errors.Wrap(err, "unable to create encryptor")
	}

	contentID := h(nil, gather.FromSlice(nil))

	var tmp gather.WriteBuffer
	defer tmp.Close()

	err = e.Encrypt(gather.FromSlice(nil), contentID, &tmp)
	if err != nil {
		return nil, errors.Wrap(err, "invalid encryptor")
	}

	return &Crypter{h, e}, nil
}
// CreateCrypter returns a Crypter based on the specified formatting options.
CreateCrypter returns a Crypter based on the specified formatting options.
// CreateCrypter returns a Crypter based on the specified formatting options .
func CreateCrypter(f *FormattingOptions) (*Crypter, error) {
	h, err := hashing.CreateHashFunc(f)
	if err != nil {
		return nil, errors.Wrap(err, "unable to create hash")
	}
	e, err := encryption.CreateEncryptor(f)
	if err != nil {
		return nil, errors.Wrap(err, "unable to create encryptor")
	}
	contentID := h(nil, gather.FromSlice(nil))
	var tmp gather.WriteBuffer
	defer tmp.Close()
	err = e.Encrypt(gather.FromSlice(nil), contentID, &tmp)
	if err != nil {
		return nil, errors.Wrap(err, "invalid encryptor")
	}
	return &Crypter{h, e}, nil
}
func CreateCrypter ( f * FormattingOptions ) ( * Crypter , error ) { h , err := hashing . CreateHashFunc ( f ) if err != nil { return nil , errors . Wrap ( err , " " ) } e , err := encryption . CreateEncryptor ( f ) if err != nil { return nil , errors . Wrap ( err , " " ) } contentID := h ( nil , gather . FromSlice ( nil ) ) var tmp gather . WriteBuffer defer tmp . Close ( ) err = e . Encrypt ( gather . FromSlice ( nil ) , contentID , & tmp ) if err != nil { return nil , errors . Wrap ( err , " " ) } return & Crypter { h , e } , nil }
CreateCrypter returns a Crypter based on the specified formatting options.
CreateCrypter returns a Crypter based on the specified formatting options .