Im trying to rewrite the all ethereum address creation and Tx creation in PHP and Im almost there. I have implemented a sha3 but now Im confused on if its giving me the correct output because it seems ethereum sha3 implemenations lack consistency when dealing with prefixed hex characters Which of the following scenarios has the correct sha3 of this RPL hash. In my php I have generated this RPL hash (its a hex output) PS Iknow the difference between Ethereum sha3 (Keccak) and standard sha3 ec0185055f9408bc82520c94145e99f7bc840f3ea42d9a64221f041f9955dca2880429d069189e000080038080
Now using Parity node and web3js I create a sha3().
Scenario 1
web3.utils.sha3('ec0185055f9408bc82520c94145e99f7bc840f3ea42d9a64221f041f9955dca2880429d069189e000080038080')
or
web3.utils.sha3('ec0185055f9408bc82520c94145e99f7bc840f3ea42d9a64221f041f9955dca2880429d069189e000080038080',{encoding:'hex'})
'0x9a8419514d3c7382a6dafc67adf18ac13b818687e9a074a0cee123e0f9a483d8'
Scenario 2
web3.utils.sha3('0xec0185055f9408bc82520c94145e99f7bc840f3ea42d9a64221f041f9955dca2880429d069189e000080038080')
'0xf1d622e8725ef0dd84e1e65239a0ecac4428b05a2ee0c219739e6e85eb57a8b6'
scenario 3
Using etheruemjs
var util = require('ethereumjs-util');
var hashed = util.sha3('0xec0185055f9408bc82520c94145e99f7bc840f3ea42d9a64221f041f9955dca2880429d069189e000000038080')
'0x0e79fdc47ef979edbbed33d347f42da74849149139db9d5a58a4038ae6bdc99c'
scenario 4
(Using etheruemjs)
var util = require('ethereumjs-util');
var hashed = util.sha3('ec0185055f9408bc82520c94145e99f7bc840f3ea42d9a64221f041f9955dca2880429d069189e000080038080')
'0x9a8419514d3c7382a6dafc67adf18ac13b818687e9a074a0cee123e0f9a483d8'