Lasso Soft Inc. > Home

[Decode_Base64URL]

LinkDecode_Base64URL
AuthorJames Harvard
CategoryEncoding
Version8.x
LicensePublic Domain
Posted08 Jan 2009
Updated08 Jan 2009
More by this author...

Description

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

Sample Usage

Decode_Base64URL('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.

define_tag( 'Base64URL', -namespace='decode_', -required='in' );
	local( 'out' = string(#in)->replace('-','+')&->replace('_','/')& );
	if( (#out->size % 4) );
		#out += ('=' * (4-(#out->size % 4))) ;
	/if;
	return( decode_base64(#out) );
/define_tag;

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft