summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2012-10-02 16:00:59 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-10-03 05:23:22 +0900
commit05a9c4d8f328c1c9fab2748a05bc8fb6911edab1 (patch)
tree6b791d222f359168bc90ffb467318e305ee54d27
parent0c3dd305c61e51de6a03084c5eee28397d82772c (diff)
utils: a helper function to convert byte array into hex string
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ryu/utils.py b/ryu/utils.py
index 1bc7ea3f..f2da6702 100644
--- a/ryu/utils.py
+++ b/ryu/utils.py
@@ -65,3 +65,7 @@ def find_flagfile(default_path=RYU_DEFAULT_FLAG_FILE):
def round_up(x, y):
return ((x + y - 1) / y) * y
+
+
+def hex_array(data):
+ return ' '.join(hex(ord(chr)) for chr in data)