[[via comment from Stack Overflow question](http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa/624379?noredirect=1#comment52401435_624379)] The `unsafe` byte->string variant to handle when `BitConverter.IsLittleEndian == false`. Comment indicates that the [original CodesInChaos source material](http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa/24343727#24343727) handles this situation, which appears true. ``` if(BitConverter.IsLittleEndian) result[i] = ((uint)s[0]) + ((uint)s[1] << 16); else result[i] = ((uint)s[1]) + ((uint)s[0] << 16); ```
[via comment from Stack Overflow question]
The
unsafebyte->string variant to handle whenBitConverter.IsLittleEndian == false.Comment indicates that the original CodesInChaos source material handles this situation, which appears true.