[Encode_Base64URL]

Description

Link: [Encode_Base64URL]
Author: James harvard
Category: Encoding
Version: 8.x
License: Public Domain
Posted: Jan. 08, 2009
Updated: Jan. 08, 2009
More by this author...

Encoding tag implementing Base64URL, as per http://www.ietf.org/rfc/rfc4648.txt. (Essentially the same as the Base64 encoding scheme but the '=' padding character is omitted and the '+' & '/' characters are exchanged for the URL-safe '-' & '_'.)

Parameters

none


Sample Usage

Encode_Base64URL( encrypt_blowfish2('Hello world James Harvard 12345',-seed='secret') );
// returns "SW9h_SZVfV0x1T9BSuLPEBdvlZWXZOe9b1LeTYp-9A" which is safe for use in URLs

// For comparison:
Encode_Base64( encrypt_blowfish2('Hello world James Harvard 12345',-seed='secret') );
// returns "SW9h/SZVfV0x1T9BSuLPEBdvlZWXZOe9b1LeTYp+9A=="
						

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
1
2
3
define_tag( 'Base64URL', -namespace='encode_', -required='in' );
	return( encode_base64(#in)->removetrailing('=')&->replace('+','-')&->replace('/','_')& );
/define_tag;

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net