gohash_db

package
v0.0.0-...-5c87083 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DBVersion is the current version of the go-hash database format.
	DBVersion = "GH01"

	// PrevDBVersion is the previous version of the database format. go-hash automatically migrates
	// databases from its previous version.
	PrevDBVersion = "GH00"

	// MinDBLength      V | S  | B1 | B2 | B3 | B4 | MAC| E
	MinDBLength = 4 + 32 + 32 + 32 + 32 + 32 + 32 + 4

	// MaxDBLength the maximum allowed size of a database
	MaxDBLength = 64 * 1000 * 1024

	// Argon2Threads the fixed number of threads to use for the Argon2 Hash function.
	Argon2Threads uint8 = 4
)

Variables

This section is empty.

Functions

func WriteDatabase

func WriteDatabase(filePath, password string, data *State) error

WriteDatabase writes the encrypted database to the given filePath with the provided state and key.

Types

type LoginInfo

type LoginInfo struct {
	Name        string
	URL         string
	Username    string
	Password    string
	Description string
	UpdatedAt   time.Time
}

LoginInfo single entry containing login information for a particular website.

func (*LoginInfo) String

func (info *LoginInfo) String() string

String human-readable representation of LoginInfo.

type State

type State map[string][]LoginInfo

State the actual login information persisted by the database.

func ReadDatabase

func ReadDatabase(filePath string, password string) (State, error)

ReadDatabase reads the encrypted database from the filePath, using the given password for decryption.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL