Convert javascript code to bash script code

Below is the javascript code which produces output after it’s successful execution to something like this 542432b384789

Math.random().toString(16).substr(2, 32)

How can reproduce this operation in the linux bash script?

Tried below code

#!/bin/bash

# Generate a random number between 0 and 1
RANDOM_NUMBER=$(Math.random())

# Convert the random number to a hexadecimal string
HEX_STRING=$(RANDOM_NUMBER.toString(16))

# Remove the first two characters of the hexadecimal string
RANDOM_STRING=$(HEX_STRING.substr(2, 32))

# Print the random string
echo $RANDOM_STRING

But it’s throwing below error messages.

test-string.sh: command substitution: line 5: syntax error near unexpected token `)'
test-string.sh: command substitution: line 5: `Math.random())'
test-string.sh: command substitution: line 8: syntax error near unexpected token `16'
test-string.sh: command substitution: line 8: `RANDOM_NUMBER.toString(16))'
test-string.sh: command substitution: line 11: syntax error near unexpected token `2,'
test-string.sh: command substitution: line 11: `HEX_STRING.substr(2, 32))'

How can we reproduce this javascript operation in the Linux bash script?