In the original code, when creating paddedHex from timeHex, the use of toString(2) seems unusual. Since timeHex is already a string, String.toString with a parameter is unnecessary (the parameter 2 is ignored). It's likely safe to remove the toString(2) call entirely.
- paddedHex = timeHex.toString(2).padStart( 16, "0" );
+ paddedHex = timeHex.padStart( 16, "0" );