added post and get test to hash prefix

This commit is contained in:
Joe Dowd
2020-08-31 02:42:25 +01:00
parent 28bd24022b
commit 82d59e159f
4 changed files with 45 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ var path = require('path');
var Sqlite = require('./Sqlite.js')
var Mysql = require('./Mysql.js');
const logger = require('../utils/logger.js');
const getHash = require('../utils/getHash.js');
let options = {
readonly: config.readOnly,
@@ -34,8 +35,8 @@ if (config.mysql) {
}
if (!config.readOnly) {
db.function("sha256", function (string) {
return require('crypto').createHash("sha256").update(string).digest("hex");
db.function("sha256", (string) => {
return getHash(string, 1);
});
// Upgrade database if required