base N tutorial video 1

This commit is contained in:
Foo Bar
2023-02-25 13:26:10 -07:00
parent 1d12ada843
commit 7b5b1b82c9
+3 -3
View File
@@ -89,7 +89,7 @@ enc(<<A:6, B:6, C:4>>) ->
% %
% 12345678 -> % 12345678 ->
% 123456 78____ % 123456 78____
% A B bsl 2 % A B bsl 4
% convert to chars -> % convert to chars ->
% CA CB = = % CA CB = =
enc(<<A:6, B:2>>) -> enc(<<A:6, B:2>>) ->
@@ -118,7 +118,7 @@ dec(Base64_String) ->
% convert to numbers -> % convert to numbers ->
% abcdef gh____ = = % abcdef gh____ = =
% NW NX % NW NX
% decompose -> % regroup ->
% abcdefgh ____ abcdef gh____ % abcdefgh ____ abcdef gh____
% <<LastByte:8, 0:4>> = << NW:6, NX:6 >> % <<LastByte:8, 0:4>> = << NW:6, NX:6 >>
dec([W, X, $=, $=], Acc) -> dec([W, X, $=, $=], Acc) ->
@@ -133,7 +133,7 @@ dec([W, X, $=, $=], Acc) ->
% convert to numbers -> % convert to numbers ->
% abcdef gh1234 5678__ = % abcdef gh1234 5678__ =
% NW NX NY % NW NX NY
% decompose -> % regroup ->
% abcdefgh 12345678 __ abcdef gh1234 5678__ % abcdefgh 12345678 __ abcdef gh1234 5678__
% << B1:8, B2:8, 0:2 >> = << NW:6, NX:6 NY:6 >> % << B1:8, B2:8, 0:2 >> = << NW:6, NX:6 NY:6 >>
dec([W, X, Y, $=], Acc) -> dec([W, X, Y, $=], Acc) ->