Script Preparation code:
x
 
function randAlphanumCode() {
    const n = Math.trunc(Math.random() * 1e3) % 62;
    return n < 10
        ? n.toString()
        : String.fromCodePoint(n + ( n < 36 ? 55 : 61 ));
}
function randAlphanumChar() {
    const n = Math.trunc(Math.random() * 1e3) % 62;
    return n < 10
        ? n.toString()
        : String.fromCharCode(n + ( n < 36 ? 55 : 61 ));
}
Tests:
  • Char

     
    randAlphanumChar()
  • Code

     
    randAlphanumCode()
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Char
    Code

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (iPhone; CPU iPhone OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Mobile/15E148 Safari/604.1
Mobile Safari 16 on iOS 16.4.1
View result in a separate tab
Test name Executions per second
Char 2967241.0 Ops/sec
Code 2662045.0 Ops/sec