mirror of
https://github.com/status-im/go-sqlcipher.git
synced 2026-08-27 16:21:09 +00:00
document sqlite3.IsEncrypted()
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user