forked from mtusi2026/mtusi2026lab7
Prepare verified laboratory 7 implementation and evidence
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export function nativeSearchWindow(
|
||||
startMilliseconds: number,
|
||||
endMilliseconds: number,
|
||||
) {
|
||||
const start_time = Math.trunc(startMilliseconds * 1000),
|
||||
end_time = Math.trunc(endMilliseconds * 1000);
|
||||
if (
|
||||
!Number.isFinite(startMilliseconds) ||
|
||||
!Number.isFinite(endMilliseconds) ||
|
||||
!Number.isSafeInteger(start_time) ||
|
||||
!Number.isSafeInteger(end_time) ||
|
||||
start_time <= 0 ||
|
||||
end_time <= start_time ||
|
||||
end_time - start_time > 3600000000
|
||||
)
|
||||
throw new Error("INVALID_OPENOBSERVE_SEARCH_WINDOW");
|
||||
return { start_time, end_time };
|
||||
}
|
||||
Reference in New Issue
Block a user