mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 22:17:14 +03:00
Add initial version of querying by hash prefix
This commit is contained in:
@@ -26,6 +26,10 @@ if (config.createDatabaseIfNotExist && !config.readOnly) {
|
||||
|
||||
// Upgrade database if required
|
||||
if (!config.readOnly) {
|
||||
// Register hashing function needed for running database upgrade
|
||||
db.function("sha256", function (string) {
|
||||
return require('crypto').createHash("sha256").update(string).digest("hex");
|
||||
});
|
||||
ugradeDB(db, "sponsorTimes");
|
||||
ugradeDB(privateDB, "private")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user