Returns a value in Base-64, since mIRC $base() only goes up to 36.
alias base64 {
var %indexTable = ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
var %input = $regsubex($$1, /(.)/g, $base($asc(\t), 10, 2, 8))
var %n = $regex(%input, /(\d{6})/g)
var %i = 1
while (%i <= %n) {
var %translate = %translate $+ $mid(%indexTable, $calc($base($regml(%i), 2, 10) + 1), 1)
inc %i
}
return %translate
}
Hello friends. We are working on the development of mirc coding and irc servers as the biggest of the Turkish irc servers, www.turkirc.com and www.Sohbet.Net. We hope that you will reach out to the world's most valuable mirc coders and share their code on the Turkish platforms and review our codes to help each other and help us live mIRC. Today, almost every feature is encoded and we are looking for new ideas. We are very pleased if you can contact us for this reason.
Contact: www.turkirc.com & www.Sohbet.Net
Mail: help@sohbet.Net
Channel #Operhelp
Nick: OxiGen & deLi
Yes, you have it too.
So, use either of these two aliases:
alias base64 return $regsubex($encode($1,m),/(.)(==?)/,$gettok(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + /,$calc((($findtokcs(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + /,\1,1,32) - 1) // (2 ^ (2 ^ $len(\2)))) + 1),32))
alias base64 return $regsubex(b64,$regsubex(b2,$1,/(.)/g,$base($asc(\t),10,2,8)),/([01]{1 $+ $chr(44) $+ 6})/g,$gettok(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + /,$calc($base(\t,2,10) + 1),32))
The first continues using $encode and the "//" limits to versions equal or superior 7.41.
It's worth noting that $encode() is a left-to-right operation, while $base() is a right-to-left operation.