mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Fix QLDocs and the qhelp example
This commit is contained in:
@@ -16,3 +16,12 @@ public void sqlCipherStorageSafe(String name, String password, String databasePa
|
||||
net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase("test", databasePassword, null);
|
||||
db.execSQL("INSERT INTO users VALUES (?, ?)", new String[] {name, password});
|
||||
}
|
||||
|
||||
private static String encrypt(String cleartext) {
|
||||
// Use an encryption or strong hashing algorithm in the real world.
|
||||
// The example below just returns a SHA-256 hash.
|
||||
MessageDigest digest = MessageDigest.getInstance("SHA-256");
|
||||
byte[] hash = digest.digest(cleartext.getBytes(StandardCharsets.UTF_8));
|
||||
String encoded = Base64.getEncoder().encodeToString(hash);
|
||||
return encoded;
|
||||
}
|
||||
Reference in New Issue
Block a user