block arr to bytes function