First working version with the account dialog.
This commit is contained in:
1 parent
8a4396fb20
commit
ad9b70173f
2 files changed
+59
-32
No files matched your search
@@ -0,0 +1,17 @@
|
||||
// see https://9to5answer.com/javascript-unicode-string-to-hex
|
||||
|
||||
export const toHex = (str: string) => {
|
||||
let hex;
|
||||
try {
|
||||
hex = unescape(encodeURIComponent(str))
|
||||
.split('')
|
||||
.map(function (v) {
|
||||
return v.charCodeAt(0).toString(16);
|
||||
})
|
||||
.join('');
|
||||
} catch (e) {
|
||||
hex = str;
|
||||
console.log('invalid text input: ' + str);
|
||||
}
|
||||
return hex;
|
||||
};
|
||||
Reference in new issue
Block a user