base N tutorial video 1
This commit is contained in:
@@ -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) ->
|
||||||
|
|||||||
Reference in New Issue
Block a user