1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 16:55:24 +03:00

Fix Android receiver tab (replace MD5 library) (#3184)

Replace MD5 library
This commit is contained in:
haslinghuis 2022-12-30 07:34:44 +01:00 committed by GitHub
parent ff5913b6cc
commit cfacb833b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 788 deletions

View file

@ -1,7 +1,7 @@
import { i18n } from "../localization";
import GUI from '../gui';
const MD5 = require('md5.js');
import { MD5 } from 'crypto-es/lib/md5.js';
const receiver = {
rateChartHeight: 117,
@ -32,10 +32,8 @@ receiver.initialize = function (callback) {
if (text) {
const bindingPhraseFull = `-DMY_BINDING_PHRASE="${text}"`;
const md5stream = new MD5();
md5stream.end(bindingPhraseFull);
const buffer = md5stream.read().subarray(0, 6);
uidBytes = Uint8Array.from(buffer);
const hash = MD5(bindingPhraseFull).toString();
uidBytes = Uint8Array.from(Buffer.from(hash, 'hex')).subarray(0, 6);
}
return uidBytes;