From a6cce5e6110466e194df80008e5ea2ebb4393f8f Mon Sep 17 00:00:00 2001 From: "Qingquan(Q.Q.) Wang" Date: Sun, 31 Jan 2021 03:45:50 +0800 Subject: [PATCH] Fix wrong _create_bin_int implementation in pssh-box.py #885. --- CONTRIBUTORS | 1 + packager/tools/pssh/pssh-box.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 85f29dcd29..2ef8829b65 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -38,6 +38,7 @@ Kongqun Yang Leandro Moreira Leo Law Piotr Srebrny +Qingquan Wang Richard Eklycke Rintaro Kuroiwa Sanil Raut diff --git a/packager/tools/pssh/pssh-box.py b/packager/tools/pssh/pssh-box.py index 27be795761..f13fc7798b 100755 --- a/packager/tools/pssh/pssh-box.py +++ b/packager/tools/pssh/pssh-box.py @@ -142,8 +142,7 @@ def _split_list_on(elems, sep): def _create_bin_int(value): """Creates a binary string as 4-byte array from the given integer.""" - return (chr(value >> 24) + chr((value >> 16) & 0xff) + - chr((value >> 8) & 0xff) + chr(value & 0xff)).encode() + return struct.pack('>i', value) def _create_uuid(data):