Team Ai
Apppublic

anas044/attendance-nodejs

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
functions.js19 linesDownload Raw Back to utils
1function generateRoomId(classId, teacherId) {
2    const timestamp = Date.now();
3    const random = Math.random().toString(36).substring(2, 15);
4    return `class_${classId}_${teacherId}_${timestamp}_${random}`;
5}
6
7function validateJitsiToken(token) {
8    try {
9        return jwt.verify(token, JWT_SECRET, { algorithms: ['HS256'] });
10    } catch (error) {
11        throw new Error('Invalid token');
12    }
13}
14
15module.exports = {
16    generateRoomId,
17    validateJitsiToken,
18    
19};