// NewDatabase creates a new database with some sensable default settings in KDBX version 3.1.
// To create a database with no settings pre-set, use gokeepasslib.Database{}
NewDatabase creates a new database with some sensable default settings in KDBX version 3.1.
To create a database with no settings pre-set, use gokeepasslib.Database{}
// NewDatabase creates a new database with some sensable default settings in KDBX version 3 . 1 . // To create a database with no settings pre - set use gokeepasslib . Database {}
func NewDatabase(options ...DatabaseOption) *Database {
	db := &Database{
		Options:     NewOptions(),
		Credentials: new(DBCredentials),
		Content:     NewContent(),
	}
	for _, option := range options {
		option(db)
	}
	if db.Header == nil {
		db.Header = NewHeader()
	}
	if db.Hashes == nil {
		db.Hashes = NewHashes(db.Header)
	}
	return db
}
func NewDatabase ( options ... DatabaseOption ) * Database { db := & Database { Options : NewOptions ( ) , Credentials : new ( DBCredentials ) , Content : NewContent ( ) , } for _ , option := range options { option ( db ) } if db . Header == nil { db . Header = NewHeader ( ) } if db . Hashes == nil { db . Hashes = NewHashes ( db . Header ) } return db }
NewDatabase creates a new database with some sensable default settings in KDBX version 3.1.
NewDatabase creates a new database with some sensable default settings in KDBX version 3 . 1 .