Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Base16 (HEX) Encode and decode functions
Topic Summary: Attached code for Base16 (HEX) encoding and decoding
Created On: 08/08/2009 04:02 AM
Status: Reply Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 08/08/2009 04:02 AM
User is offline View Users Profile Print this message

Author Icon
ErikHedlund
Expert (100-199)

Posts: 152
Joined: 12/08/2008

I've recently been working with Sql Server Service Broker to collect events from Automate with a vbascript when the set variable on error is fired or when the script is called manually.

All messages sent to the broker are Xml messages (AMEventNotification).

Sometimes I'm in need of attaching logfiles, compressed files and so on to these events. The content of those files made my xml events mallformed. I needed to encode the contents. My solution was to create a tag <BinaryData>...</BinaryData> and encode the contents as either Base64 or Base16. Base16 is hex and is not supported by Automate.

I've attached the code for Base16 encoding and decoding. In addition there are a couple of more effecient byte conversion functions attached.

There are some topics on this at google, but I had to think for myself this time as there were no soutable or at least effecient enough solutions for vbscript.



 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
Erik Hedlund
Senior systemarchitect
A-team member
+4793028609

 09/03/2009 02:04 PM
User is offline View Users Profile Print this message

Author Icon
ErikHedlund
Expert (100-199)

Posts: 152
Joined: 12/08/2008

Have to post an update on this one, because I found that the performance was a bit to slow on large files.

The attached code uses msxml for encoding and decoding base64. There also a couple of functions using the adodb stream object to do effecient string to byte array and byte array to string conversion.



 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
Erik Hedlund
Senior systemarchitect
A-team member
+4793028609

Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1282 guests browsing this forum, which makes a total of 1282 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2018 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog