document sqlite3.IsEncrypted()

This commit is contained in:
Frank Braun
2017-05-08 21:04:03 +00:00
parent 81d39a96e8
commit 0fd2b12476
2 changed files with 7 additions and 2 deletions
+4
View File
@@ -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
+3 -2
View File
@@ -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)