File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/remote-feature-flag-controller/src/utils Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export function generateDeterministicRandomNumber(
3131 let cleanId : string , value : bigint ;
3232 // uuidv4 format
3333 if ( uuidValidate ( metaMetricsId ) && uuidVersion ( metaMetricsId ) === 4 ) {
34- cleanId = metaMetricsId . replace ( / ^ ( .{ 12 } ) 4 / u, '$1f' ) . replace ( / - / gu , ' ') ;
34+ cleanId = metaMetricsId . replace ( / - / gu , '' ) . replace ( / ^ ( .{ 12 } ) 4 / u, '$1f' ) ;
3535 value = BigInt ( `0x${ cleanId } ` ) ;
3636 } else {
3737 // hex format with 0x prefix
@@ -40,7 +40,7 @@ export function generateDeterministicRandomNumber(
4040 }
4141 const maxValue = BigInt ( `0x${ 'f' . repeat ( cleanId . length ) } ` ) ;
4242 // Use BigInt division first, then convert to number to maintain precision
43- return Number ( ( value * BigInt ( 1000000 ) ) / maxValue ) / 1000000 ;
43+ return Number ( ( value * BigInt ( 1_000_000 ) ) / maxValue ) / 1_000_000 ;
4444}
4545
4646/**
You can’t perform that action at this time.
0 commit comments