{"ScriptPreparationCode":null,"TestCases":[{"Name":"hashlookup","Code":"let md5 = \u002711111111111111111111111111111111\u0027;\r\nlet sha1 = \u00271111111111111111111111111111111111111111\u0027;\r\nlet sha256 = \u00271111111111111111111111111111111111111111111111111111111111111111\u0027;\r\nlet invalid = \u002721345\u0027;\r\nconst hashLookup = ( () =\u003E {\r\n const hashes = {\r\n 32: \u0027md5\u0027,\r\n 64: \u0027sha256\u0027,\r\n 40: \u0027sha1\u0027\r\n };\r\n return function( hash ) { return hashes[ hash.length ]; };\r\n} )();\r\n\r\nconst size = 10000;\r\nfor (let i = 0; i \u003C size; i\u002B\u002B){\r\nhashLookup(md5);\r\nhashLookup(sha1);\r\nhashLookup(sha256);\r\nhashLookup(invalid);\r\n}","IsDeferred":false},{"Name":"hashswitch","Code":"let md5 = \u002711111111111111111111111111111111\u0027;\r\nlet sha1 = \u00271111111111111111111111111111111111111111\u0027;\r\nlet sha256 = \u00271111111111111111111111111111111111111111111111111111111111111111\u0027;\r\nlet invalid = \u002721345\u0027;\r\nhashSwitch = function hashSwitch( hash ) {\r\n switch( hash.length ) {\r\n case 32: {\r\n return \u0027md5\u0027;\r\n }\r\n case 40: {\r\n return \u0027sha1\u0027;\r\n }\r\n case 64: {\r\n return \u0027sha256\u0027;\r\n }\r\n }\r\n}\r\nconst size = 10000;\r\nfor (let i = 0; i \u003C size; i\u002B\u002B){\r\nhashSwitch(md5);\r\nhashSwitch(sha1);\r\nhashSwitch(sha256);\r\nhashSwitch(invalid);\r\n}","IsDeferred":false}]}