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>
This commit is contained in:
Isaku Yamahata 2012-10-02 16:00:59 +09:00 committed by FUJITA Tomonori
parent 0c3dd305c6
commit 05a9c4d8f3

View File

@ -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)