Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/klauspost/password
/ functions
Functions
93 in github.com/klauspost/password
⨍
Functions
93
◇
Types & classes
22
↓ 9 callers
Function
Import
Import will populate a database with common passwords. You must supply a Tokenizer (see tokenizer package for default tokenizers) that will deliver t
password.go:123
↓ 7 callers
Method
Close
()
bulk.go:72
↓ 7 callers
Method
Sanitize
(string)
password.go:52
↓ 7 callers
Function
SanitizeOK
SanitizeOK can be used to check if a password passes the sanitizer. If the sanitizer is nil, DefaultSanitizer will be used.
password.go:240
↓ 5 callers
Function
Check
Check a password against the database. It will return an error if: - Sanitazition fails. - DB lookup returns an error - Password is in database (ErrPa
password.go:206
↓ 5 callers
Method
Has
(string)
password.go:45
↓ 4 callers
Method
Add
(string)
password.go:39
↓ 4 callers
Function
inDB
inDB will return information if a password is in the database
password_test.go:20
↓ 3 callers
Function
_filePath
(dir, name string)
testdata/generated.go:207
↓ 3 callers
Function
truncate
(s string)
drivers/sqlpw/sql.go:146
↓ 2 callers
Function
Asset
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
testdata/generated.go:69
↓ 2 callers
Method
Init
()
password.go:113
↓ 2 callers
Method
ModTime
()
testdata/generated.go:39
↓ 2 callers
Method
Name
()
testdata/generated.go:30
↓ 2 callers
Function
NewMysql
NewMysql returns a new database wrapper, set up for MySQL. You must supply a schema (that should already exist), as well as the column the passwords
drivers/sqlpw/sql.go:60
↓ 2 callers
Function
NewPostgresql
NewPostgresql returns a new database wrapper, set up for PostgreSQL. You must supply a "schema.table" (that should already exist), as well as the col
drivers/sqlpw/sql.go:74
↓ 2 callers
Function
truncate
Cut runes off the end until the string is below 512 bytes.
drivers/mgopw/mgo.go:57
↓ 1 callers
Method
Add
Add an entry to the password database
drivers/sqlpw/sql.go:85
↓ 1 callers
Method
Add
Has satisfies the password.DbWriter interface. It writes a single password to the database
drivers/bloompw/bloom.go:31
↓ 1 callers
Method
AddMultiple
([]string)
bulk.go:8
↓ 1 callers
Function
AssetDir
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data c
testdata/generated.go:134
↓ 1 callers
Function
AssetInfo
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
testdata/generated.go:95
↓ 1 callers
Method
Mode
()
testdata/generated.go:36
↓ 1 callers
Function
New
New will return a new Database interface that read/writes items to a single bucket.
drivers/boltpw/boltdb.go:17
↓ 1 callers
Function
New
New will return a new Database interface that stores entries in a bloom filter
drivers/bloompw/bloom.go:18
↓ 1 callers
Function
New
New returns a new database. Supply a valid (copy of a) session and the database and collection you would like to use. The correct keyspace must be set
drivers/cassandra/cassandra.go:26
↓ 1 callers
Function
New
New returns a new database. Supply a valid (copy of a) session and the database and collection you would like to use.
drivers/mgopw/mgo.go:29
↓ 1 callers
Function
NewMemDB
NewMemDB creates a new MemDB instance
drivers/testdb/memdb.go:20
↓ 1 callers
Function
NewMemDBBulk
NewMemDBBulk will return a new MemDBBulk
drivers/testdb/memdb.go:47
↓ 1 callers
Method
Next
()
password.go:62
↓ 1 callers
Function
RestoreAsset
RestoreAsset restores an asset under the given directory
testdata/generated.go:166
↓ 1 callers
Function
TestData
TestData will test that the data imported with TestImport is correctly returned. It will test "Has" function of the driver. If any error is returned t
drivers/testing.go:81
↓ 1 callers
Function
TestImport
TestImport will import about 1500 entries into your database. It will test "Add" and "AddMultiple" (if available). If any error is returned the test f
drivers/testing.go:47
↓ 1 callers
Function
bulkWrap
(out BulkWriter)
bulk.go:22
↓ 1 callers
Function
tempfile
tempfile returns a temporary file path.
drivers/boltpw/boltdb_test.go:15
↓ 1 callers
Function
testdataTxtGzBytes
()
testdata/generated.go:51
Method
Add
(s string)
bulk.go:55
Method
Add
Has satisfies the password.DbWriter interface. It writes a single password to the database
drivers/boltpw/boltdb.go:49
Method
Add
Add a password to the MemDB. It must silently ignore duplicates If an error is returned Import is aborted.
drivers/testdb/memdb.go:28
Method
Add
Add a single entry
drivers/testdb/memdb.go:63
Method
Add
Add an entry to the password database
drivers/cassandra/cassandra.go:35
Method
Add
Add an entry to the password database
drivers/mgopw/mgo.go:39
Method
AddMultiple
AddMultiple satisfies the password.BulkWriter interface. It writes a number of passwords to the database
drivers/boltpw/boltdb.go:59
Method
AddMultiple
Add multiple entries to the password database
drivers/sqlpw/sql.go:98
Method
AddMultiple
AddMultiple is the function that will be called with several items at once.
drivers/testdb/memdb.go:54
Method
AddMultiple
AddMultiple satisfies the password.BulkWriter interface. It writes a number of passwords to the database
drivers/bloompw/bloom.go:38
Function
AssetNames
AssetNames returns the names of the assets.
testdata/generated.go:108
Method
Close
Should be called when finished
tokenizer/linereader.go:69
Function
ExampleImport
()
password_test.go:301
Function
ExampleImport_xz
Open a xz compressed archive and import it. Uses the "xi2.org/x/xz" package to read xz files.
password_test.go:50
Function
ExampleNewMysql
Example of using a MySQL database. This assumes "test-table" has been created in "testdb". It could have been created like this: CREATE TABLE `test
drivers/sqlpw/mysql_test.go:54
Function
ExampleNewPostgresql
Example of using a Postgres database Uses 'pwtesttable' in the 'testschema' schema, and reads/adds to the "pass" column. Table can be created like t
drivers/sqlpw/postgres_test.go:90
Function
ExampleSanitizer
This example shows how to create a custom sanitizer that checks if the password matches the username or email. CustomSanitizer is defined as: type Cu
password_test.go:283
Method
Has
Has satisfies the password.DB interface
drivers/boltpw/boltdb.go:37
Method
Has
Has will return true if the database has the entry.
drivers/sqlpw/sql.go:130
Method
Has
Has will check if the database has a specific password. If any error is returned, it will be forwarded to your "Check()" call.
drivers/testdb/memdb.go:37
Method
Has
Has returns true if the map has the string
drivers/testdb/memdb.go:70
Method
Has
Has satisfies the password.DB interface
drivers/bloompw/bloom.go:25
Method
Has
Has will return true if the database has the entry.
drivers/cassandra/cassandra.go:40
Method
Has
Has will return true if the database has the entry.
drivers/mgopw/mgo.go:46
Method
Init
()
bulk.go:32
Method
IsDir
()
testdata/generated.go:42
Function
MustAsset
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
testdata/generated.go:83
Function
New
New returns a new database. You must give an query, that returns the number of rows matching the parameter given. You must give an insert statement
drivers/sqlpw/sql.go:47
Function
NewBz2Line
NewBz2Line reads one password per line until \0xa (newline) is encountered. The input is assumed to be bzip2 compressed. Input is streamed. If r does
tokenizer/linereader.go:51
Function
NewGzLine
NewGzLine reads one password per line until \0xa (newline) is encountered. The input is assumed to be gzip compressed. Input is streamed.
tokenizer/linereader.go:35
Function
NewLine
NewLine reads one password per line until \0xa (newline) is encountered. Input is streamed.
tokenizer/linereader.go:25
Method
Next
Next returns the data on the next line. Will return io.EOF when there is no more data.
tokenizer/linereader.go:60
Function
RestoreAssets
RestoreAssets restores an asset under the given directory recursively
testdata/generated.go:191
Function
Sanitize
Sanitize will sanitize a password, useful before hashing and storing it. If the sanitizer is nil, DefaultSanitizer will be used.
password.go:229
Method
Sanitize
doc at DefaultSanitizer
password.go:99
Method
Sanitize
(s string)
password_test.go:247
Method
Size
()
testdata/generated.go:33
Method
Sys
()
testdata/generated.go:45
Function
TestBloom
Test a bloom database
drivers/bloompw/bloom_test.go:13
Function
TestBolt
Test a bolt database
drivers/boltpw/boltdb_test.go:23
Function
TestCassandra
Test a Cassandra database
drivers/cassandra/cassandra_test.go:13
Function
TestDefaultSanitizer
(t *testing.T)
password_test.go:211
Function
TestDriver
TestDriver will test a driver by running TestImport followed by TestData
drivers/testing.go:30
Function
TestImport
(t *testing.T)
password_test.go:32
Function
TestImportBig
(t *testing.T)
password_test.go:71
Function
TestImportBulk
(t *testing.T)
password_test.go:100
Function
TestImportBz2
(t *testing.T)
password_test.go:87
Function
TestInDB
(t *testing.T)
password_test.go:121
Function
TestInDBBulk
(t *testing.T)
password_test.go:166
Function
TestMemDB
Test a MemDB database
drivers/testdb/memdb_test.go:12
Function
TestMemDBBulk
Test a MemDBBulk database
drivers/testdb/memdb_test.go:20
Function
TestMongo
Test a Mongo database
drivers/mgopw/mgo_test.go:14
Function
TestMySQL
Test a MySQL database
drivers/sqlpw/mysql_test.go:14
Function
TestPostgres
Test a Postgres database To run locally, use the "-pgpass" password to set the postgres user password.
drivers/sqlpw/postgres_test.go:22
Function
init
()
password.go:79
Function
init
()
drivers/sqlpw/postgres_test.go:16
Function
testdataTxtGz
()
testdata/generated.go:55