Use pack() instead of sprintf().