My Nonparametrics: Statistical Methods based on Ranks (Lehmann, 1975 edition) gives the formula as:
$p(r=2k) = 2\frac{{n-1\choose{k-1}}^2}{2n\choose{n}}$
where the number of runs is counted as both the runs up and down. Asymptotically,
$ \frac{r - n}{\sqrt{n}} \sim \text{N}(0,1)$
An alternative procedure is of course to do a permutation test; generate 10,000 or so random sequences by randomly permuting the collection of data points, and calculate the test statistic for each sequence. You can then compare your calculated test statistic on the original sequence with the collection of randomly-generated test values to get a p-value.
Note that this does not account for the possibility of ties, which is a definite possibility in the OP's case, as each byte can only take on one of 256 possible values.