I have to upload files, and a nice thing to do is run a checksum at the client 
and server and verify that the checksums match.

When I upload a file, I also upload another parameter with the computed SHA256 
checksum.  As the server processes the upload, it generates a SHA256 checksum, 
too, and compares it to the uploaded parameter.

Also, make sure your server and the value from NSBasic are in the same case 
(lowercase or uppercase), as that could lead to an erroneous failure.

It is pretty easy to run a SHA256 checksum on a server, but here is how to do 
it in NSBasic/CE:

AddObject "newObjects.utilctls.SFMain", "file"
AddObject "newObjects.crypt.HashObject", "hash"

Function sha256Checksum(checksum_filename)
   Dim result, handle
   result = ""
   If file.FileExists(checksum_filename) Then
      Set handle = file.OpenFile(checksum_filename,&H40)
      hash.InitHash "SHA256"   
      hash.HashData handle.ReadBin(handle.Size)
      handle.Close
      result = hash.Value
      hash.ResetKey
   End If
   sha256Checksum = result
End Function


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to