From How can I make this PHP merkle root script recursive?

function binFlipByteOrder($string) {
    return implode('', array_reverse(str_split($string, 1)));

Why a flip?


Hashes are big endian by standard, and most computers use little endian, so it's probably just for convenience. See Why does the Bitcoin protocol use the little-endian notation?

  • Ok thanks you! (I suspected the Lilliputians..) Nov 26 '18 at 15:37
  • haha they are alive and well in Bitcoin... :)
    – JBaczuk
    Nov 26 '18 at 15:37
  • Of course it's a little big part of Internet (Cohen) and a community story :) So they are well in Bitcoin :) Nov 27 '18 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.