![]() |
|
![]() |
AutoMate Discussion | ![]() |
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: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
||||
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.
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 ![]() |
||||
|
||||
![]() |
||||
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.
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 ![]() |
||||
|
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.