File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 33
33
interface
34
34
35
35
uses
36
+ System.SysUtils,
36
37
{ $IFDEF DELPHIXE7_UP}
37
38
System.NetEncoding;
38
39
{ $ELSE}
@@ -42,6 +43,10 @@ interface
42
43
43
44
function Base64Encode (const Input: string): string;
44
45
function Base64Decode (const Input: string): string;
46
+ { $IFDEF DELPHIXE7_UP}
47
+ function Base64DecodeFromBinary (const Input: string) : string;
48
+ function Base64DecodeToBytes (const Input: string) : TBytes;
49
+ { $ENDIF}
45
50
46
51
implementation
47
52
@@ -63,5 +68,20 @@ function Base64Decode(const Input: string): string;
63
68
{ $ENDIF}
64
69
end ;
65
70
71
+ { $IFDEF DELPHIXE7_UP}
72
+ function Base64DecodeFromBinary (const Input: string) : string;
73
+ var
74
+ b : TBytes;
75
+ begin
76
+ b := TNetEncoding.Base64.DecodeStringToBytes(Input);
77
+ Result := TEncoding.ANSI.GetString(b);
78
+ end ;
79
+
80
+ function Base64DecodeToBytes (const Input: string) : TBytes;
81
+ begin
82
+ Result := TNetEncoding.Base64.DecodeStringToBytes(Input);
83
+ end ;
84
+ { $ENDIF}
85
+
66
86
end .
67
87
You can’t perform that action at this time.
0 commit comments