<commit_before>package gokeepasslib

import (
	"bytes"
	"compress/gzip"
	"crypto/aes"
	"crypto/cipher"
	"crypto/sha256"
	"encoding/binary"
	"encoding/xml"
	"io"
)

const blockSplitRate = 16384

type Encoder struct {
	w io.Writer
}

func (e *Encoder) Encode(db *Database) error {
	err := e.writeData(db)
	if err != nil {
		return err
	}

	return nil
}

func NewEncoder(w io.Writer) *Encoder {
	return &Encoder{w: w}<commit_msg>simpler way of returning error<commit_after>package gokeepasslib

import (
	"bytes"
	"compress/gzip"
	"crypto/aes"
	"crypto/cipher"
	"crypto/sha256"
	"encoding/binary"
	"encoding/xml"
	"io"
)

const blockSplitRate = 16384

type Encoder struct {
	w io.Writer
}

func (e *Encoder) Encode(db *Database) error {
	err := e.writeData(db)
	return err
}

func NewEncoder(w io.Writer) *Encoder {
	return &Encoder{w: w}
{'fraction_non_alphanumeric': 0.1317365269461078, 'fraction_numerical': 0.019161676646706587, 'mean_word_length': 4.291139240506329, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4276833', 'n_tokens_mistral': 348, 'n_tokens_neox': 328, 'n_words': 80}