diff --git a/branch_name_hex.py b/branch_name_hex.py new file mode 100644 index 0000000000000000000000000000000000000000..709be0298eda574c91d31c29e6f8df7a068a979c --- /dev/null +++ b/branch_name_hex.py @@ -0,0 +1,8 @@ +from functools import reduce + +utf16le_hex = lambda name_part: reduce( + lambda s,next: s+next, (("%02x" % ch) for ch in name_part.encode("utf-16le")) +) + +result = '/'.join(utf16le_hex(part) for part in input().split('/')) +print(result)