From 1e00f7822298762af7ef78c22a57574740ed650d Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Mon, 2 Dec 2019 19:48:03 +0100 Subject: [PATCH] Make hex conversion shorter --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f03046d..b402a6a 100644 --- a/README.md +++ b/README.md @@ -85,9 +85,9 @@ devAddr = [0x00, 0x00, 0x00, 0x00] nwkSKey = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] appSKey = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] -devAddr_hex = " ".join(list(map(lambda x: "{0:02x}".format(x), devAddr))).upper() -nwkSKey_hex = " ".join(list(map(lambda x: "{0:02x}".format(x), nwkSKey))).upper() -appSKey_hex = " ".join(list(map(lambda x: "{0:02x}".format(x), appSKey))).upper() +devAddr_hex = " ".join(["%02X" % (x,) for x in devAddr]) +nwkSKey_hex = " ".join(["%02X" % (x,) for x in nwkSKey]) +appSKey_hex = " ".join(["%02X" % (x,) for x in appSKey]) print("devAddr: ", devAddr_hex) print("nwkSKey: ", nwkSKey_hex) print("appSKey: ", appSKey_hex)