mirror of
https://github.com/Rate-Limiting-Nullifier/Discreetly.git
synced 2026-01-09 12:37:55 -05:00
9 lines
311 B
TypeScript
9 lines
311 B
TypeScript
import { poseidon2 } from 'poseidon-lite/poseidon2';
|
|
|
|
export function genId(serverID: bigint, roomName: string | bigint | number) {
|
|
if (typeof roomName === 'string') {
|
|
return poseidon2([serverID, BigInt(Buffer.from(roomName).toString('hex', 16))]);
|
|
}
|
|
return poseidon2([serverID, BigInt(roomName)]);
|
|
}
|