Click here to Skip to main content
15,615,787 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi i make serialz to json file and get this value

"HEADER""DATETIMEISSUED""2023-01-27T00:34:00Z""RECEIPTNUMBER""INV-112""UUID""1""PREVIOUSUUID""1""REFERENCEOLDUUID""1""CURRENCY""EGP""EXCHANGERATE""0""SORDERNAMECODE""SORDERNAMECODE""ORDERDELIVERYMODE""FC""DOCUMENTTYPE""RECEIPTTYPE""SC""TYPEVERSION""1.2""SELLER""RIN""619013583""COMPANYTRADENAME""شركة الصوفى""BRANCHCODE""0""BRANCHADDRESS""COUNTRY""EG""GOVERNATE""CAIRO""REGIONCITY""CITY CENTER""STREET""16 STREET""BUILDINGNUMBER""14BN""POSTALCODE""74235""FLOOR""1F""ROOM""3R""LANDMARK""TAHRIR SQUARE""ADDITIONALINFORMATION""TALAAT HARB STREET""DEVICESERIALNUMBER""SOFT2010""ACTIVITYCODE""5610""BUYER""TYPE""F""ID""313717919""NAME""TAXPAYER 1""MOBILENUMBER""+201020567462""PAYMENTNUMBER""987654""ITEMDATA""ITEMDATA""INTERNALCODE""880609""DESCRIPTION""SAMSUNG""ITEMTYPE""GS1""ITEMCODE""037000401629""UNITTYPE""EA""QUANTITY""35""UNITPRICE""247.96000""NETSALE""7810.74000""TOTALSALE""8678.60000""TOTAL""8887.04360""COMMERCIALDISCOUNTDATA""COMMERCIALDISCOUNTDATA""AMOUNT""867.86000""DESCRIPTION""XYZ""ITEMDISCOUNTDATA""ITEMDISCOUNTDATA""AMOUNT""10""DESCRIPTION""ABC""ITEMDISCOUNTDATA""AMOUNT""10""DESCRIPTION""XYZ""VALUEDIFFERENCE""20""TAXABLEITEMS""TAXABLEITEMS""TAXTYPE""T1""AMOUNT""1096.30360""SUBTYPE""V009""RATE""14""TOTALSALES""8678.60000""TOTALCOMMERCIALDISCOUNT""867.86000""TOTALITEMSDISCOUNT""20""EXTRARECEIPTDISCOUNTDATA""EXTRARECEIPTDISCOUNTDATA""AMOUNT""0""DESCRIPTION""ABC""NETAMOUNT""7810.74000""FEESAMOUNT""0""TOTALAMOUNT""8887.04360""TAXTOTALS""TAXTOTALS""TAXTYPE""T1""AMOUNT""1096.30360""PAYMENTMETHOD""C""ADJUSTMENT""0"


iam use this code to get sha256 value
Dim sha256 As New SHA256CryptoServiceProvider()
        Dim byteValue() As Byte = System.Text.Encoding.UTF8.GetBytes(input)
        Dim byteHash() As Byte = sha256.ComputeHash(byteValue)

        '  Convert the byte array to hexadecimal string
        Dim sb = New StringBuilder()
        For i = 0 To byteHash.Length - 1
            sb.Append(byteHash(i).ToString("X2"))
        Next
        Console.WriteLine(sb.ToString)

this value not same when use php code
$jsonAsArray = json_decode($jsonAsString,true);


What I have tried:

hi i make serialz to json file  and  get this value 

<pre>"HEADER""DATETIMEISSUED""2023-01-27T00:34:00Z""RECEIPTNUMBER""INV-112""UUID""1""PREVIOUSUUID""1""REFERENCEOLDUUID""1""CURRENCY""EGP""EXCHANGERATE""0""SORDERNAMECODE""SORDERNAMECODE""ORDERDELIVERYMODE""FC""DOCUMENTTYPE""RECEIPTTYPE""SC""TYPEVERSION""1.2""SELLER""RIN""619013583""COMPANYTRADENAME""شركة الصوفى""BRANCHCODE""0""BRANCHADDRESS""COUNTRY""EG""GOVERNATE""CAIRO""REGIONCITY""CITY CENTER""STREET""16 STREET""BUILDINGNUMBER""14BN""POSTALCODE""74235""FLOOR""1F""ROOM""3R""LANDMARK""TAHRIR SQUARE""ADDITIONALINFORMATION""TALAAT HARB STREET""DEVICESERIALNUMBER""SOFT2010""ACTIVITYCODE""5610""BUYER""TYPE""F""ID""313717919""NAME""TAXPAYER 1""MOBILENUMBER""+201020567462""PAYMENTNUMBER""987654""ITEMDATA""ITEMDATA""INTERNALCODE""880609""DESCRIPTION""SAMSUNG""ITEMTYPE""GS1""ITEMCODE""037000401629""UNITTYPE""EA""QUANTITY""35""UNITPRICE""247.96000""NETSALE""7810.74000""TOTALSALE""8678.60000""TOTAL""8887.04360""COMMERCIALDISCOUNTDATA""COMMERCIALDISCOUNTDATA""AMOUNT""867.86000""DESCRIPTION""XYZ""ITEMDISCOUNTDATA""ITEMDISCOUNTDATA""AMOUNT""10""DESCRIPTION""ABC""ITEMDISCOUNTDATA""AMOUNT""10""DESCRIPTION""XYZ""VALUEDIFFERENCE""20""TAXABLEITEMS""TAXABLEITEMS""TAXTYPE""T1""AMOUNT""1096.30360""SUBTYPE""V009""RATE""14""TOTALSALES""8678.60000""TOTALCOMMERCIALDISCOUNT""867.86000""TOTALITEMSDISCOUNT""20""EXTRARECEIPTDISCOUNTDATA""EXTRARECEIPTDISCOUNTDATA""AMOUNT""0""DESCRIPTION""ABC""NETAMOUNT""7810.74000""FEESAMOUNT""0""TOTALAMOUNT""8887.04360""TAXTOTALS""TAXTOTALS""TAXTYPE""T1""AMOUNT""1096.30360""PAYMENTMETHOD""C""ADJUSTMENT""0"


iam use this code to get sha256 value
Dim sha256 As New SHA256CryptoServiceProvider()
        Dim byteValue() As Byte = System.Text.Encoding.UTF8.GetBytes(input)
        Dim byteHash() As Byte = sha256.ComputeHash(byteValue)

        '  Convert the byte array to hexadecimal string
        Dim sb = New StringBuilder()
        For i = 0 To byteHash.Length - 1
            sb.Append(byteHash(i).ToString("X2"))
        Next
        Console.WriteLine(sb.ToString)

this value not same when use php code
$jsonAsArray = json_decode($jsonAsString,true);
Posted
Updated 31-Jan-23 19:39pm
Comments
Richard Deeming 30-Jan-23 4:17am    
Your question makes absolutely no sense. Your sample input is very clearly not JSON; and your VB.NET code and your PHP code are doing two completely different things.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900