decord/source/modules/rtc/TransientKeyStore.tsx

53 lines
1.5 KiB
TypeScript
Raw Normal View History

// Module ID: 9276
// Function ID: 9277
// Name: TransientKeyStore
// Dependencies: [504, 573, 2]
2026-07-23 10:11:24 +00:00
// Module 9276 (TransientKeyStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
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) {
value = map.get(arg0);
2026-07-29 08:29:29 +00:00
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";
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);
}
});
const size = fn(2);
let result = size.fileFinishedImporting("modules/rtc/TransientKeyStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default transientKeyStore;