mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-05 02:39:26 +02:00
feat: migrate to Uint8Array
This commit is contained in:
parent
cb988f5563
commit
96b5807691
39 changed files with 429 additions and 752 deletions
|
@ -24,7 +24,7 @@ const classNames = mergeStyleSets({
|
|||
});
|
||||
|
||||
function serializePacket(packet: AdbPacketInit) {
|
||||
const command = decodeUtf8(new Uint32Array([packet.command]).buffer);
|
||||
const command = decodeUtf8(new Uint32Array([packet.command]));
|
||||
|
||||
const parts = [
|
||||
command,
|
||||
|
@ -35,7 +35,7 @@ function serializePacket(packet: AdbPacketInit) {
|
|||
if (packet.payload) {
|
||||
parts.push(
|
||||
Array.from(
|
||||
new Uint8Array(packet.payload),
|
||||
packet.payload,
|
||||
byte => byte.toString(16).padStart(2, '0')
|
||||
).join(' ')
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue