9 lines
305 B
TypeScript
9 lines
305 B
TypeScript
import * as crypto from 'crypto';
|
|
|
|
export function hashLevels(levels : any[]) : string {
|
|
let c = levels.map(lvl => `${lvl.id.toString()[0]}${lvl.id.toString().slice(-1)}${lvl.stars}0`).join('');
|
|
|
|
let shasum = crypto.createHash('sha1');
|
|
shasum.update(c + 'xI25fpAapCQg');
|
|
return shasum.digest('hex');
|
|
} |