please dont rip this site

This variation of the Base64 encodeing sytem is slightly cheaper to code than the standard due to the rearranging of the values used.

6 bit input value ASCII character range produced gap
0...9 "0"..."9" 30h, 48d, '0'
10...35 "A"..."Z" 7, 'A'-':'
36...61 "a"..."z" 6, 'a'-'['
62 "+" -80d, -50h, '+'-'{'
63 "?" 20d, 14h, '?'-','

Encode 3 bytes into 4 bytes consisting of only the characters 0...9, A...Z, a...z, and +

Entry:

lodsd
dec esi
mov edx,eax
mov ecx,4
.Repeat
	and al, 00111111y
	add al, ('0')
	.If al > '9'
		add al, ('A' - ':')
		.If al > 'Z'
			add al, ('a' - '[')
			.If al > 'z'
				.if al > 'z'+1
					mov al, '?'
				.else
					mov al, '+'
					.EndIf
				.EndIf
			.EndIf
		.EndIf

	stosb
	shr edx, 6
	mov al,dl
	.Untilcxz

Decode

	get value
		.if al < 'a'
		.if al < 'A'
			.if al < '0'
				.if al == '+'
					mov al, 62
				.else
					stc
					breakpoint
					.endif
			.elseif al > '9'
				.if al == '?'
					mov al, 63
				.else
					stc
					breakpoint
					.endif
			.else
				;0...9
				sub al, '0'
				.endif
		.elseif al > 'Z'
			stc
			breakpoint
		.else
			;A...Z
			sub al, 'A' - 10
			.endif
	.elseif al > 'z'
			stc
			breakpoint
	.else
		;a...z
		sub al, 'a' - 36
		.EndIf

Better?

	sub al, '0'
	.if Carry?
		.if al == '+' - '0'
			mov al, 62
		.else
			breakpoint ;invalid character in Mime input stream
			.endif
	.else
		.if al > 9
			sub al, 'A' - ':' ; if it was A, now its 10
			.if Carry?
				.if al == '?' - ('A' - '0')
					mov al, 63
				.else
					breakpoint ;invalid character in Mime input stream
					.endif
			.else
				.if al > 9 + 26
					sub al, 'a' - '[' ; if it was a, now its 36
					.if al > 9 + 26 + 26
						breakpoint ;invalid character in Mime input stream
						.endif
					.endif
				.endif
			.endif
		.endif
	



file: /Techref/method/b64n.htm, 2KB, , updated: 2018/2/1 15:33, local time: 2024/12/22 12:52,
TOP NEW HELP FIND: 
3.141.198.75:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.ecomorder.com/Techref/method/b64n.htm"> X86 Base64 Variant</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to ecomorder.com!

 

Welcome to massmind.ecomorder.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .