I encountered this and it appears that it happens because your OS headers don't define BYTE_ORDER. I don't know what Linux distributions omit this, but I solved this by doing
$ wget http://cran.stat.ucla.edu/src/contrib/digest_0.6.3.tar.gz
$ tar zxvf digest_0.6.3.tar.gz
Then edit digest/src/sha2.c and stick the following line in there near the top:
#define BYTE_ORDER LITTLE_ENDIAN
(this is assuming your machine is, in fact, little endian; Intel/AMD processors fall into this category). Then
R CMD INSTALL digest
* installing to library ‘/N/u/glock/sierra/R/lib64/R/library’
* installing *source* package ‘digest’ ...
file ‘src/sha2.c’ has the wrong MD5 checksum
The wrong MD5 checksum is harmless.