add function to get bytes directly

because python2 doesn't have the handly int.to_bytes feature and 128bit
ints are not highly portable.