base64 - base64 and URL encoding and decoding + md5hashing

This XOP does several useful encoding of strings.
1) It does base64 encoding and decoding of strings (useful for network utilities).
2) It does URL encoding of strings (useful for network utilities).
3) It does an md5 hash of a string.

Usage:
//base64
string testing = "test"
testing = base64encode(testing)
testing = base64decode(testing)

//URLencoding
string testing = "test test"
print URLencode(testing)

//md5 hashing
string testing = "The quick brown fox jumps over the lazy dog"
print md5hash(testing)
//should print 9e107d9d372bb6826bd81d3542a419d6

Project Details

Project CVS: http://svn.igorexchange.com/viewvc/packages/base64/

Current Project Release

base64 IGOR.5.00.x-1.0.x-dev

Release File: base64-IGOR.5.00.x-1.0.x-dev.zip
Version: IGOR.5.00.x-1.0.x-dev
Version Date: Wed, 11/09/2011 - 02:00 am
Version Major: 1
Version Extra: dev
OS Compatibility: Mac-Intel Windows
Release Notes: Encodes and Decodes strings into base64
View All Releases

Hello,

Thank you very much for making this XOP that I've been using for several years now. Unfortunately I appears that base64 is not compatible with Igor7.

Is there any plan to upgrade this XOP.

Best regards,

Alex

Alex:

I can't say whether Andy plans to update the XOP, but I believe the XOP is mostly or completely obsolete as Igor 7 and Igor 8 have built-in functions to do these things.

URLEncode/URLDecode are used for URL encoding/decoding.

The Hash function can be used for multiple kinds of hashes of string data, including MD5. Igor 8 adds the WaveHash function, which can be used to hash a wave.

Base64 encoding/decoding is provided by the "secret" Base64_Encode and Base64_Decode functions in Igor 7. For Igor 8, these were made official and their names were changed to Base64Decode and Base64Encode to match the names used by this XOP. In this case, "secret" means that you can use the function in your code but it isn't documented in the Help Browser. If you need to see the documentation, you can find it in http://wavemetrics.net/doc/igorman/IgorMan.pdf. This is the Igor 8 documentation, but the functions work the same way in Igor 7, just with different names. Search for "Base64Encode" or "Base64Decode".

If you want to write code so that it can be used with Igor 8 also, do something like this:

#if IgorVersion() < 8
Function/S Base64Encode(myString)
    String myString
    return Base64_Encode(myString)
End

Function/S Base64Decode(myString)
    String myString
    return Base64_Decode(myString)
End
#endif
   
Function test()
    string testing = "test"
    testing = base64encode(testing)
    print testing
   
    testing = base64decode(testing)
    print testing
End

These wrapper functions will allow you to use the proper Igor 8 names for the functions in your code if you're using Igor 7.

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More