Calculated Checksum Different Than C# Equivalent?

Feb 23, 2010

This comparison shows the different values of the known good checksum calculation (c#) as used by my client and what I 'hoped' was the vb.net equivalent. How can I get 405 rather than 513 as I currently do?

For i = 0 To length - 2 Step 1
cksum += sendFrameData(i + 5)
Next i

[Code]....

View 3 Replies


ADVERTISEMENT

Accelerate The Generation Of The MD5 Checksum?

Mar 17, 2010

I'm working with some very large files residing on P2 (Panasonic) cards. Part of the process we employ is to first generate a checksum of the file we are going to copy, then copy the file, then run a checksum on the file to confirm that it copied OK. The problem is, is that files are large (70 GB+) and take a long time to complete. It's an issue since we will eventually be dealing with thousands of these files.

I would like to find a faster way to generate the checksum other than using the System.Security.Cryptography.MD5CryptoServiceProvider I don't care if this means using a specialized hardware card, provided it works and is not to ungodly expensive. I would prefer to have a method of encoding that provided some feedback as to how far the process has gone along so I can display it like I do now.

The application is written in vb.net. I would prefer to be able to use it as component, library, reference within my application, but I'm willing to call an outside application if there is enough improvement in the speed of generating the checksum.

Needless to say, the checksum must be consistent and correct.

View 2 Replies

Convert A String To Get A Checksum?

Nov 30, 2011

I need to convert a string to get a checksum as follows;

Checksum

The checksum is the 8 LSB (least significant bits) of a simple addition of all octets (note that a message type '30' is two octets with the values 33 hex and 30 hex) following the STX character and until the checksum field. Note that all separators will be included in the checksum, but the STX, checksum and the ETX will not be included.

Dim str as string = "01/00064/O/30/12345678/87654321////////48656C6C6F20576F726C64/"

This should result in checksum = "C2" What type of checksum is this? what should I Google for? CRC, MD5, hash ?

View 1 Replies

Adding Bytes For Checksum From Array

Sep 14, 2009

Dim sum As Byte
Dim Trans_Array(_64K, 2) As Byte
Const _64K As Integer = 65536
sum = 0
For i = 0 To 15
BinaryStream.Write(Trans_Array(Address + i, RIGHT_FILE))
sum = (Convert.ToByte(sum + Trans_Array(Address + i, RIGHT_FILE)))
Next
I can't figure out how to calculate the checksum of the bytes from array.

View 10 Replies

Calculate A Checksum Value To Add To The String As The Last Byte To Be Sent?

Oct 4, 2011

I have the following hex string 40 50 4C 41 59 0D I am transmitting to a piece of equipment, I need to calculate a checksum value to add to the string as the last byte to be sent. The checksum byte is generated in such a manner that the result of addition of all bytes of a message will become 11111111(255). the code that you see here does not work can anyone tell/show me why? Whats important is the checksum calculation.

[Code]...

View 1 Replies

Checksum Integrity Checking Against Patching?

Sep 17, 2011

Is it possible for my application to check if its been modified?

e.g. Could i compile the app and use a 3rd party tool to calculate the MD5 checksum of the compiled exe - and inside the app, code it so that if the MD5 checksum doesnt match then run the deactivation process?

I know its not foolproof but if it makes it slightly more hassle to crack my app i'd rather have it

View 1 Replies

Generate Main App And Dll Checksum Eachother?

Mar 24, 2010

Is there any way to generate checksum for a dll from the main app (compiled) and the main app from the dll when I run the main app or something of this kind?

View 3 Replies

VS 2010 (One App): 24-bit Word - Creating UDP Datagram - Calculating Checksum

Sep 22, 2011

I'm trying to create an app that controls a BSS BLU-80 (DSP) through Ethernet. I've written a few basic programs in the past, but nothing that used sockets or even required calculating a checksum. One of the values I need to send has to be 24 bits. This one really has me scratching my head. From the manufacturer's docs:

[Code]...

View 5 Replies

Change This Checksum Function To Accept An Integer Input Instead Of A String?

Dec 31, 2009

This function doesn't work if I change the input argument 'pdu' from a string to an int.Would someone please help me figure out what to do here so that the checksum does not add the ascii value of the int argument but rather the actual integer value?I took out a few lines of the actual function but it adds the input argument to a packet sent out via TCP protocol.This function shows the integer value just fine in the string that gets encoded as a byte array. the checksum is wrong.!

''Public Function buildpacket(pdu As Integer) is what I want.
Public Function buildpacket(pdu As String)
Dim packet As String

[code]....

View 1 Replies

VS 2010 - Generate A CRC16-X25 Checksum In The Form HiByte And LowByte

Apr 12, 2012

I've wanting to generate a CRC16-X25 checksum in the form HiByte and LowByte. All the examples I've found by searching are either VB6 which uses functions and data types that are no longer supported or C, C++ etc. Does anyone have a simple VB.Net version? Speed is not an issue.

View 10 Replies

VS 2010 Signed And Unsigned Integer NOT: For Hex File Checksum Computation?

Feb 22, 2012

I have been trying to compute the checksum for a line of hex code. This is to create a hex file which will be loaded onto an embedded micro.Some of you guys may not know how this is done so very briefly:

a line of hex bytes:

: 10 01 00 00 21 46 01 36 01 21 47 01 36 00 7E FE 09 D2 19 01 40

The underlined bytes are taken and summed. (in this case the decimal 960). and the bold is the checksum Only the 8LSB (or single least significant byte) is needed to compute the checksum... which in this case, 960 = 03C0 in hex, so only C0 is needed.Two's complement is then taken:

step 1) logical not of C0 which is
step 2) add one (integer)
BIN...........DEC...HEX

[code]....

So here is the code I have been using: (quick mention that in the string passed, the hex bytes are all grouped together, there are no space characters)

Public Sub CreateLine(ByVal Data As String)
'Dim BDataArray(DataLength) As Byte
Dim IDataArray(Data.Length) As Integer

[code]....

where i get into trouble is where i commented 'i get into trouble'. My code works, but it's rather crude Now, in that line i first convert the hex value (string) "SChecksum" into an integer. I want to NOT this, so I get my step 2 from my explanation. However, the results appears to be a signed logical NOT. which gives me the wrong answer. My hashed togther version simply subtracts 256 before the not, in order to give me the correct answer.

Basically, I would love for someone to chime in and point out the flaws in my function, and push me towards figuring out the 'proper' way of doing this. Also I can't quite wrap my head around what would happen in the case a string were passed to my function that is over 16 bits, but I imagine I would have to subtract a larger value than 256, before doing the NOT in this case?(whilst we're on the subject of functions, I've used a 'sub', in which case should I used a sub, and which case should I use a function?).

View 4 Replies

Add Calculated Field In Datagridview?

Jun 30, 2009

i have data coming from sql server with two columns like total items, total packed items. Now in datagridview i want to show another column to calculate %age.Total Packed Items / Total Items Is it possible to add calculated column in datagridview?

View 4 Replies

Decimals In Calculated Cell Value?

Oct 1, 2011

i have three cells in a datagridview third cell gives the result of multiplying first and second cell.When i reload or populate this data from datatable into that datagridview value comes like 40.00. with two decimals. For example

58.00 -------->i need only 58

58.78--------->i need exact 58.78

The only problem is to remove the decimals if they are 0.

View 10 Replies

Forms :: Calculated Column With SQL

Feb 2, 2010

I am attempting to develop a Gradebook that one can use to modify grades and have an average calculated at the end.When you first open the form, you see the database fields in the DataGrid (socSecNumber, firstExam, secondExam, finalExam)I have a button to save the changes made here. The exam grades are null in the database.This seems to work fine, however I have a problem with the calculated column I want to add. I want it to display the socSecNumber and the average for that student. Instead, I get all four fields in addition to the semAverage field. Also, all the grades come up 250 if I fill all the fields in with 100.[code]

View 2 Replies

Forms :: Get The Red Color If The Calculated?

May 15, 2010

i have a problem with my program i want to work with 2 color's red and green i want get the red color if the calculated - and green if it is +

[Code]...

View 1 Replies

Getting The DataGridView Calculated Field?

Jul 13, 2011

I have a DataGridView that call a stored procedure. One of the fields is a calculated field, ie Quantity * Price.When I run the stored proc on the server, the calculated field returns a result that shows 2 decimal places to the right of the decimal point. When I run the stored proc in the VB application to fill the DGV, the result in the calculated field shows up to 8 places to the right of the decimal place. Is there a way that it will show only 2 places in the application?

View 3 Replies

How Are Coordinates Calculated On A Form

Dec 5, 2009

How are coordinates calculated on a form?

Consider the following code:

[Code].....

View 1 Replies

C# - How A Month Is Calculated In The Rest Of The World

Jan 11, 2012

I'm just curious that how a month is calculated in the rest of the world because Differences in Months between two dates are calculated differently. In our Insurance Company, we calculate a month as below:

[Code]...

View 1 Replies

Datagrid With Calculated Fields Error

Dec 27, 2009

I have a DataGrid as a child of a Customer Form based on a Query like this

[code]...

View 1 Replies

Group By And Aggregate On A Calculated Column

Feb 20, 2011

how to change this Linq to Entities (VB.Net) query to Group by L2_ID column and aggregate the calculated column diff as Sum for the group.

[Code]...

View 1 Replies

Sorting Gridview On A Calculated Field?

Apr 15, 2011

I have a gridview that displays a calculated field, based on a db source field it populates with.

can i sort by it? i can't seem to figure out how to do it?

example:

my templatefield looks like this:
<asp:TemplateField HeaderText="Category" SortExpression="category" >
<ItemTemplate>
<asp:Label runat="server" Text='<%# BuildCategory(DataBinder.Eval(Container, "DataItem.category")) %>'
ID="lblPrice"></asp:Label>
</ItemTemplate>
</asp:TemplateField>

where category is party of the datasource, but what gets displayed is a calculated value - which is different from the category.what can i put in the "SOrtExpression" to make it sort by the new value - taht gets displayed?

View 1 Replies

Store Calculated Values Into An Array?

Mar 8, 2011

I am attempting to teach myself visual basic and I cannot figure out how to send a calculated value (on a button click) into a one-dimension array and then recall the last five values in a message box when the user exits.

Here's what I have:

Public Class frmInvoiceTotal
Dim totals(4) As Decimal
Private Sub btnCalculate_Click(ByVal sender As System.Object,

[Code]....

View 7 Replies

VS 2010 Calculated Fields In A Datagrid?

Feb 17, 2011

My program is databound to an access 2007 database. I have a datagridview showing rows as part of my screen and the other part of my screen is texboxes bound to a different table.What I currently have:

1. Date in textbox from one table

2. Age in Datagridview column from another table

I need help with having a calculated date column in the datagridview that will be the textbox date + age (in days) in the datagrid column. I would also need this column to store in my database like any other field also. So if I typed in 2/17/11 into the textbox, and I typed in 2 in the age field, the calculated field would display and store 2/19/2011 in my datagrid and database. My dataset designer won't let me add a date to a string so I'm completely lost. A query calculates it easy in access but when I load the access query in my dataset it doesn't calculate anymore.

View 4 Replies

Calculated Value On TextChanged Event Can't Be Updated To Database

Jan 14, 2010

I have invoice form bound to a bindingsource and bindingnavigator. In the form I have unit price, quantity and total textboxes. The total textbox text property is set to total.text = quantity.text * unitprice.text in the textChanged event of both quantity and unitprice text boxes. The result is displayed in the total textbox. But when i hit save button on the bindingnavigator it is set to null and not saved to database. [code]When I used msgbox to see the value of total textbox before bindingsource.endEdit() it is the correct value. but after the code bindingsource.endEdit() it is null. I checked the databinding property and it is correct. What is the problem.

View 1 Replies

Cannot Get Listbox To Display Calculated Values For Each Integer Along Way

Mar 22, 2011

I am working with a future value application and I am trying to display the calculated future values in a listbox. For instance, I input the monthly investment, the yearly interest rate and the number of years into textboxes and I want the application to list out the future value for each year until the number of years in which I entered is reached. I cannot figure out how to get the code to display the value after each year. I am trying to use the "mod" operator to display the value each time the 12th month comes around.[code]...

View 7 Replies

DB/Reporting :: Calculated Field In Report Table?

Dec 3, 2008

I have a RDLC report with a list that contains a table. I require a calculated column whose value depends on values from previous rows. Outside of a report I accomplish the same thing using code in a DataGridView's DataBindingComplete method.

From within a report how do I refer to specific cell values from previous rows? embedded code, but I have not had luck (#Error).

View 1 Replies

Plot A Graph From Values Calculated From A Database?

Apr 19, 2011

ive been struggling on this portion of my code for almost 3 days with no luck. i have a database containing a list of transactions (in this case, the product name, quantity and date of sale). I want to plot a graph for each product showing the amount sold each month for the past 12 months. The functions to calculate these values are working fine. but my problem is this:

each tab page is named after the product name:

TabControl_SaleOfProducts.TabPages.Add(
"TabPage_"
& ProductName, Item)

and then to this tab page i want to add the graph. but i cannot reference the newly created tab page?

View 2 Replies

Add A Calculated Count Column To An Existing Datagridview At Runtime?

Aug 4, 2011

in my tableadapter query i have a count function "COUNT(PRIMVENDOR)" to give me the number of rows in each group by:

SELECT VENALPHA, PRIMVENDOR, [GROUP], COUNT(PRIMVENDOR) AS GrpCount
FROM ViewCurrentMasterFile
WHERE (PRIMVENDOR = @VenNum)

[Code].....

View 3 Replies

Datagridview With Bound And Unbound Calculated Columns Won't Display

May 4, 2011

DataGridView1 is bound to a sql table. Cells(0) and (1) come from that table. Cells(2) and (3) are calculated. While debugging the code, the calculations and lookup look fine, but the results will not display in the columns. Here is the code:

Dim SeatsUsed As Integer = 0
For Each r As DataGridViewRow In DataGridView1.Rows
Try

[code]....

View 5 Replies

Debug Calculated Function Returns Without A Return Variable?

Jul 13, 2010

It's often the case that I can write a nice tight little VB.NET function, and when it comes time to do the Return statement, it's really natural to just return the result of a quick calculation or a method call. However, this makes it difficult if I need to step through the debugger to see what is going to be returned from that Function. For example, take this simple method to illustrate the concept[code]...

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved