8 lines
183 B
JavaScript
8 lines
183 B
JavaScript
// @flow
|
|
export function toHex(str: string): string {
|
|
var result = '';
|
|
for (var i = 0; i < str.length; i++) {
|
|
result += str.charCodeAt(i).toString(16);
|
|
}
|
|
return result;
|
|
}
|