Skip to content

Commit 73ea8da

Browse files
committed
simplify uuid
1 parent ea0d6c4 commit 73ea8da

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/hooks/custom/SplitPdfHook.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import async from "async";
2-
import {randomUUID} from 'crypto';
32

43
import {
54
AfterErrorContext,
@@ -26,6 +25,7 @@ import {
2625
} from "./utils/index.js";
2726
import {
2827
HTTPClientExtension,
28+
generateGuid,
2929
MIN_PAGES_PER_THREAD,
3030
PARTITION_FORM_FILES_KEY,
3131
PARTITION_FORM_SPLIT_PDF_PAGE_KEY,
@@ -99,7 +99,7 @@ export class SplitPdfHook
9999
): Promise<Request> {
100100

101101
// setting the current operationID to be unique
102-
const operationID = "partition-" + randomUUID();
102+
const operationID = "partition-" + generateGuid();
103103
hookCtx.operationID = operationID;
104104

105105
const requestClone = request.clone();

src/hooks/custom/common.ts

+4
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ export class HTTPClientExtension extends HTTPClient {
4646
return super.request(request);
4747
}
4848
}
49+
50+
export function generateGuid() {
51+
return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
52+
}

0 commit comments

Comments
 (0)