summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lowlevelunit.pas18
1 files changed, 18 insertions, 0 deletions
diff --git a/lowlevelunit.pas b/lowlevelunit.pas
index 7ad86a4..94ada62 100644
--- a/lowlevelunit.pas
+++ b/lowlevelunit.pas
@@ -82,6 +82,8 @@ function hexDump(p: pointer; cnt: longint): string;
function base64ToBin(var s: string): boolean;
function base64Decode(const s: string; out i: qword): boolean; overload;
function base64Decode(const s: string; out i: longword): boolean; overload;
+function base64Encode(i: longword): string; overload;
+function base64Encode(i,siz: longword): string; overload;
function mirrorBits(qw: qword): qword; overload;
function mirrorBits(lw: longword): longword; overload;
function mirrorBits(w: word): word; overload;
@@ -713,6 +715,22 @@ begin
i:=0;
end;
+function base64Encode(i: longword): string;
+begin
+ result:=base64Encode(i,(8*sizeof(i)+7) div 6);
+end;
+
+function base64Encode(i,siz: longword): string;
+var
+ j: longint;
+begin
+ result:='';
+ for j:=0 to siz-1 do begin
+ result:=base64Chars[i and $3f]+result;
+ i:=i shr 6;
+ end;
+end;
+
function mirrorBits(qw: qword): qword;
begin
result:=