Reputation: 289
I have a sting to hash with sha-256
string= ACCEPTURL=http://atifali.com/pn/index.php?ic=paymentdone&id=E0I0m21E20n2OddgqckVb$Y8U027S7$1+++HASHKEY+++AMOUNT=7600+++HASHKEY+++BGCOLOR=#f1f3f2+++HASHKEY+++BUTTONBGCOLOR=#2f85c4+++HASHKEY+++BUTTONTXTCOLOR=#FFFFFF+++HASHKEY+++CANCELURL=http://atifali.com/pn/?ic=payment+++HASHKEY+++CN=WAQAS KHAN+++HASHKEY+++CURRENCY=GBP+++HASHKEY+++DECLINEURL=http://atifali.com/pn/?ic=payment+++HASHKEY+++EXCEPTIONURL=http://atifali.com/pn/?ic=payment+++HASHKEY+++HOMEURL=http://atifali.com/pn/+++HASHKEY+++LANGUAGE=en_us+++HASHKEY+++ORDERID=sterlingpharma1234+++HASHKEY+++PSPID=sterlingpharma+++HASHKEY+++TXTCOLOR=#2f85c4+++HASHKEY+++
expected result by ogone is:
979600BF6E1789CDD18B0F5669C7F2A958E88736B4C23BE2FC0B47FEF25496AF
but I'm having the result as:
267B4AD7CF0ACD3E2111ADD33CAFDD91EE1C4ACAEEF946C846D92A220283D4D9
by using:
strtoupper(hash('sha256',$stringToHash))
Upvotes: 0
Views: 216
Reputation: 14163
I was curious and give it a go. I checked the manual on page 14 and found some input string.
I used your code on the value and the result was
E019359BAA3456AE5A986B6AABD22CF1B3E09438739E97F17A7F61DF5A11B30F
Which is exactly the same as I get on SHA Test Page from ogone.
So the hash function is correct. I guess you misformed the actual string. Best way to test is with an easy string like 'test'.
Upvotes: 1