File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -683,10 +683,14 @@ export const signPdfFun = async (
683683} ;
684684
685685export const randomId = ( ) => {
686- const randomBytes = crypto . getRandomValues ( new Uint16Array ( 1 ) ) ;
687- const randomValue = randomBytes [ 0 ] ;
688- const randomDigit = 1000 + ( randomValue % 9000 ) ;
689- return randomDigit ;
686+ // 1. Grab a cryptographically-secure 32-bit random value
687+ const randomBytes = crypto . getRandomValues ( new Uint32Array ( 1 ) ) ;
688+ const raw = randomBytes [ 0 ] ; // 0 … 4 294 967 295
689+
690+ // 2. Collapse into a 90 000 000-wide band (0…89 999 999), then shift to 10 000 000…99 999 999
691+ const eightDigit = 10_000_000 + ( raw % 90_000_000 ) ;
692+
693+ return eightDigit ;
690694} ;
691695
692696export const createDocument = async (
@@ -1552,7 +1556,7 @@ export const multiSignEmbed = async (
15521556 let hasError = false ;
15531557 for ( let item of widgets ) {
15541558 //pdfOriginalWH contained all pdf's pages width and height
1555- //'getSize' is used to get particular pdf's page width and height
1559+ //'getSize' is used to get particular pdf's page width and height
15561560 const getSize = pdfOriginalWH . find (
15571561 ( page ) => page ?. pageNumber === item ?. pageNumber
15581562 ) ;
Original file line number Diff line number Diff line change @@ -455,7 +455,7 @@ const Forms = (props) => {
455455 setBcc ( [ ] ) ;
456456 setFolder ( { ObjectId : "" , Name : "" } ) ;
457457 const notifySign =
458- extUserData ?. NotifyOnSignatures
458+ extUserData ?. NotifyOnSignatures !== undefined
459459 ? extUserData ?. NotifyOnSignatures
460460 : true ;
461461 setFormData ( {
@@ -534,7 +534,7 @@ const Forms = (props) => {
534534 setBcc ( [ ] ) ;
535535 setFolder ( { ObjectId : "" , Name : "" } ) ;
536536 const notifySign =
537- extUserData ?. NotifyOnSignatures
537+ extUserData ?. NotifyOnSignatures !== undefined
538538 ? extUserData ?. NotifyOnSignatures
539539 : true ;
540540 let obj = {
Original file line number Diff line number Diff line change 11# Use an official Node runtime as the base image
22FROM node:22.14.0
33
4+ RUN wget https://download.oracle.com/java/23/archive/jdk-23_linux-x64_bin.deb \
5+ && dpkg -i jdk-23_linux-x64_bin.deb
46
57# Set the working directory inside the container
68WORKDIR /usr/src/app
You can’t perform that action at this time.
0 commit comments