fix non-format eslint in src/

This commit is contained in:
Michael C
2021-07-12 02:12:22 -04:00
parent 9445a06871
commit c0b1d201ad
66 changed files with 829 additions and 834 deletions

View File

@@ -1,12 +1,12 @@
import crypto from 'crypto';
import { HashedValue } from '../types/hash.model';
import crypto from "crypto";
import { HashedValue } from "../types/hash.model";
export function getHash<T extends string>(value: T, times = 5000): T & HashedValue {
if (times <= 0) return "" as T & HashedValue;
for (let i = 0; i < times; i++) {
const hashCreator = crypto.createHash('sha256');
value = hashCreator.update(value).digest('hex') as T;
const hashCreator = crypto.createHash("sha256");
value = hashCreator.update(value).digest("hex") as T;
}
return value as T & HashedValue;