a lot
This commit is contained in:
17
packages/common/src/profileId.ts
Normal file
17
packages/common/src/profileId.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { hashPassword } from './crypto';
|
||||
|
||||
interface GenerateProfileIdOptions {
|
||||
salt: string;
|
||||
ua: string;
|
||||
ip: string;
|
||||
origin: string;
|
||||
}
|
||||
|
||||
export async function generateProfileId({
|
||||
salt,
|
||||
ua,
|
||||
ip,
|
||||
origin,
|
||||
}: GenerateProfileIdOptions) {
|
||||
return await hashPassword(`${ua}:${ip}:${origin}`, salt, 8);
|
||||
}
|
||||
Reference in New Issue
Block a user