decord/source/modules/rtc/TransientKeyStore.tsx

52 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9730
// Function ID: 9731
2026-07-29 08:29:29 +00:00
// Name: map
// Dependencies: [589, 709, 2]
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
// Module 9730 (map)
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
2026-07-20 16:05:17 +00:00
const map = new Map();
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class TransientKeyStore extends Store {
}
const prototype = TransientKeyStore.prototype;
prototype["getUsers"] = function getUsers() {
return map;
};
prototype["isKeyVerified"] = function isKeyVerified(arg0, arg1) {
const value = map.get(arg0);
if (null != arg1) {
if (null != value) {
if (value.length === arg1.length) {
let num = 0;
if (0 < arg1.length) {
while (arg1[num] === value[num]) {
num = num + 1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return true;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
}
return false;
};
TransientKeyStore.displayName = "TransientKeyStore";
2026-08-24 06:08:38 +00:00
const transientKeyStore = new TransientKeyStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen() {
map.clear();
},
SECURE_FRAMES_TRANSIENT_KEY_CREATE: function handleSecureFramesTransientKeyCreate(key) {
const uint8Array = new Uint8Array(key.key);
const result = map.set(key.userId, uint8Array);
},
SECURE_FRAMES_TRANSIENT_KEY_DELETE: function handleSecureFramesTransientKeyDelete(userId) {
return map.delete(userId.userId);
}
});
2026-07-29 08:29:29 +00:00
let result = require("set").fileFinishedImporting("modules/rtc/TransientKeyStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default transientKeyStore;