I was trying to figure out why sha3("\x80") is different from sha3("0x80", {encoding:'hex'} )
web3.sha3( "\x80" )
"0x0f50dcb7f76b82d3cf8c843adacd5cb4d1ce1b6de2ef1f2557f196d07c26f08e"
web3.sha3( "0x80" , { encoding : 'hex' } )
"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
but it works if my bytes are all < 0x80. For example if i try it with \x70 :
web3.sha3( "\x70" )
"0x2304e88f144ae9318c71b0fb9e0f44bd9e0c6c58fb1b5315a35fd8b4b2a444ab"
web3.sha3( "0x70" , { encoding : 'hex' } )
"0x2304e88f144ae9318c71b0fb9e0f44bd9e0c6c58fb1b5315a35fd8b4b2a444ab"
The reason i m asking is because while i can use { encoding : 'hex' } with web3.js but this option is not available in tronWeb.js's tronWeb.sha3() which only takes 1 argument . So i m thinking of a workaround if i don't have the { encoding : 'hex' } option to use.