<p>Hashes are big endian by standard, and most computers use little endian, so it's probably just for convenience. See <a href="https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation">Why does the Bitcoin protocol use the little-endian notation?</a></p>

CC BY-SA 4.0
2018-11-26T15:37:08.667Z
Ok thanks you! (I suspected the Lilliputians..)
Nicolas Cantu
CC BY-SA 4.0
2018-11-26T15:37:48.683Z
haha they are alive and well in Bitcoin... :)
JBaczuk
CC BY-SA 4.0
2018-11-27T00:26:28.093Z
Of course it's a little big part of Internet (Cohen) and a community story :) So they are well in Bitcoin :)
Nicolas Cantu
CC BY-SA 4.0
2018-11-26T15:28:44.063Z
2018-11-26T15:28:44.063Z
JBaczuk
<p>From <a href="https://bitcoin.stackexchange.com/questions/43565/how-can-i-make-this-php-merkle-root-script-recursive">How can I make this PHP merkle root script recursive?</a></p>

<pre><code>function binFlipByteOrder($string) {
    return implode('', array_reverse(str_split($string, 1)));
}
</code></pre>

<p>Why a flip?</p>

<blockchain><php>
Why a flip a bin before hashing in this script?
Nicolas Cantu
# Why a flip a bin before hashing in this script?

(Asked by: username_0 on 2018-11-26)

From [How can I make this PHP merkle root script recursive?](https://bitcoin.stackexchange.com/questions/43565/how-can-i-make-this-php-merkle-root-script-recursive)

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

```

Why a flip?

**Tags:** blockchain, php


---

## 1 answers

### Answer by username_1 on 2018-11-26. Score: 3 | Accepted answer

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?](https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation)

> **Comments:**
> **username_0**: Ok thanks you! (I suspected the Lilliputians..)  
> **username_1**: haha they are alive and well in Bitcoin... :)  
> **username_0**: Of course it's a little big part of Internet (Cohen) and a community story :) So they are well in Bitcoin :)  

---

