Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Recreating Perl Unpack function in VB

 
Logged in as: Guest
arrSession:exec spGetSession 2,4,64820
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP.NET >> Recreating Perl Unpack function in VB
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Recreating Perl Unpack function in VB - 10/6/2008 1:53:01 AM   
  djjohnnyg

 

Posts: 1
Score: 0
Joined: 10/6/2008
Status: offline
Hi,

I am trying to recreate a perl script in VB but have a problem creating a checksum value that a target system needs.  

In Perl this checksum is calculated using the unpack function:

while (<PACKAGE>) {
$checksum += unpack("%32C*", $_);
   }
   $checksum %= 32767;
   close(PACKAGE);
}

where PACKAGE is the .tar file input stream

I need to replicate this in VB but can't find a means of replicating that unpack function.

All help appreciated!

(I know there are much better checksum calculations available but can't change target system so can't change calculation)
 
 
Post #: 1
 
 RE: Recreating Perl Unpack function in VB - 10/17/2008 1:16:21 AM   
  TNO


Posts: 1284
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
I've seen that you've posted this question across a significant number of forums without a good reply, (that I've seen yet). A couple years ago I think we tackled a similar problem as this:

http://www.visualbasicscript.com/m_40662/mpage_1/key_big%2cendian/tm.htm

It's not .NET, but maybe the logic we came up with would help

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to djjohnnyg)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP.NET >> Recreating Perl Unpack function in VB Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts