We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cffa09 commit e6a48ceCopy full SHA for e6a48ce
src/js/tabs/receiver.js
@@ -52,7 +52,13 @@ receiver.initialize = function (callback) {
52
if (text) {
53
const bindingPhraseFull = `-DMY_BINDING_PHRASE="${text}"`;
54
const hash = CryptoES.MD5(bindingPhraseFull).toString();
55
- uidBytes = Uint8Array.from(Buffer.from(hash, 'hex')).subarray(0, 6);
+ // Buffer.from is not available in the browser
56
+ const bytes = hash.match(/.{1,2}/g).map(byte => parseInt(byte, 16));
57
+ const view = new DataView(new ArrayBuffer(6));
58
+ for (let i = 0; i < 6; i++) {
59
+ view.setUint8(i, bytes[i]);
60
+ }
61
+ uidBytes = Array.from(new Uint8Array(view.buffer));
62
}
63
64
return uidBytes;
0 commit comments