mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
352 B
13 lines
352 B
6 years ago
|
'use strict';
|
||
|
|
||
5 years ago
|
const { tripcodeSecret } = require(__dirname+'/../../configs/main.json')
|
||
5 years ago
|
, { createHash } = require('crypto')
|
||
6 years ago
|
|
||
|
module.exports = async (password) => {
|
||
|
|
||
5 years ago
|
const tripcodeHash = createHash('sha256').update(password + tripcodeSecret).digest('base64');
|
||
|
const tripcode = tripcodeHash.substring(tripcodeHash.length-10);
|
||
|
return tripcode;
|
||
6 years ago
|
|
||
|
}
|