diff --git a/README.md b/README.md index 6d1ebf5..e34ccfa 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ you want a different value than the default 1024 bytes). API documentation can be found here: http://godoc.org/github.com/mutecomm/go-sqlcipher +Use the function +[sqlite3.IsEncrypted()](https://godoc.org/github.com/mutecomm/go-sqlcipher#IsEncrypted) +to check whether a database file is encrypted or not. + Examples can be found under the `./_example` directory diff --git a/sqlcipher.go b/sqlcipher.go index 03c632c..c0e5e5f 100644 --- a/sqlcipher.go +++ b/sqlcipher.go @@ -9,8 +9,9 @@ import ( // sqlite3Header defines the header string used by SQLite 3. var sqlite3Header = []byte("SQLite format 3\000") -// IsEncrypted returns true, if the file with filename is encrypted, false -// otherwise. If the file cannot be read properly an error is returned. +// IsEncrypted returns true, if the database with the given filename is +// encrypted, and false otherwise. +// If the database header cannot be read properly an error is returned. func IsEncrypted(filename string) (bool, error) { // open file db, err := os.Open(filename)