Could be written as
```python
return reduce(lambda a, b: a + ("\n" if len(a)==23 else " ") + b, ("%02x" % ord(c) for c in x))
```
Just kidding :)