admin stuff

This commit is contained in:
Flummi
2021-05-19 14:19:26 +02:00
parent a681f1da0e
commit 96a3b47935
12 changed files with 272 additions and 16 deletions

View File

@@ -1,3 +1,5 @@
import crypto from "crypto";
const epochs = [
["year", 31536000],
["month", 2592000],
@@ -27,4 +29,7 @@ export default new class {
const { interval, epoch } = getDuration(~~((new Date() - new Date(date)) / 1e3));
return `${interval} ${epoch}${interval === 1 ? "" : "s"} ago`;
}
md5(str) {
return crypto.createHash('md5').update(str).digest("hex");
}
};