String to Hexadecimal

Benchmark created on


Setup

string = '1fd59253-e8ab-41af-8228-74f8df01-5e3c-403f-a539-29f59cf8b350'


Test runner

Ready to run.

Testing in
TestOps/sec
with Array.map()
string.split('').map(char => char.charCodeAt(0).toString(16).padStart(2, '0')).join('');
ready
with Array.reduce()
string => str.split('').reduce((hex, char) => hex.concat(char.charCodeAt(0).toString(16).padStart(2, '0')), '');
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.