Created
May 23, 2019 07:39
-
-
Save x13945/beebf4b0699d274c60d7870053e82234 to your computer and use it in GitHub Desktop.
生成iterm中快捷键需要对hex code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toHex(str) { | |
var result = ''; | |
for (var i = 0; i < str.length; i++) { | |
result += `0x${str.charCodeAt(i).toString(16)} `; | |
} | |
return result; | |
} | |
let res = toHex('http') | |
console.log('===================================='); | |
console.log(res); | |
console.log('===================================='); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment