Sign in to follow this  
Followers 0
AcidicChip

Convert string to mime?

2 posts in this topic

I'm making a function to login to a site, and I'm doing this thru TCPConnect, etc. The basic authentication is user:pass but encoded to mime (or something like that?).

Here's the function in an IRC client called mIRC...

$encode(%var | &binvar, mubt, N)

$decode(%var | &binvar, mubt, N)

Encode or decode text in %vars or &binvars using Uuencode or Mime.

The second parameter consists of switches, where m = mime, u = uucode (default), b = &binvar, and t = text (default).

The final encoded line is made up of 60-character chunks. You can specify N if you want mIRC to return the Nth chunk. N = 0 returns the total number of chunks in the line.

If encoding/decoding a &binvar, the identifiers return the actual number of characters written to the &binvar. Note that encoding uses 33% more storage space.

The last two parameters are optional, default to uuencode, and N = 1.

Here's the usage:

sockwrite -n $sockname Authorization: Basic $encode(SomeUsername:SomePassword,m) $+ $str($crlf,2)

Can anyone tell me what function would be the same or if there is a UDF to achieve this?

P.S.

When receiving the data from teh connection, it gives back raw header, and chunked data (sometimes). That's good, but a way to parse the chunked data would be nice. Anyone have a UDF for that as well?

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0