File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ contains
5252 RALCripto in '..\..\src\utils\RALCripto.pas',
5353 RALCriptoAES in '..\..\src\utils\RALCriptoAES.pas',
5454 RALCustomObjects in '..\..\src\utils\RALCustomObjects.pas',
55- RALHashes in '..\..\src\utils\RALHashes .pas',
55+ RALHashBase in '..\..\src\utils\RALHashBase .pas',
5656 RALJson in '..\..\src\utils\RALJson.pas',
5757 RALMD5 in '..\..\src\utils\RALMD5.pas',
5858 RALMIMETypes in '..\..\src\utils\RALMIMETypes.pas',
@@ -72,6 +72,7 @@ contains
7272 RALStorageCSV in '..\..\src\utils\RALStorageCSV.pas',
7373 RALStorageJSON in '..\..\src\utils\RALStorageJSON.pas',
7474 RALStorageBIN in '..\..\src\utils\RALStorageBIN.pas',
75- RALDBTypes in '..\..\src\base\RALDBTypes.pas';
75+ RALDBTypes in '..\..\src\base\RALDBTypes.pas',
76+ RALHashes in '..\..\src\utils\RALHashes.pas';
7677
7778end.
Original file line number Diff line number Diff line change 191191 <DCCReference Include="..\..\src\utils\RALCripto.pas"/>
192192 <DCCReference Include="..\..\src\utils\RALCriptoAES.pas"/>
193193 <DCCReference Include="..\..\src\utils\RALCustomObjects.pas"/>
194- <DCCReference Include="..\..\src\utils\RALHashes .pas"/>
194+ <DCCReference Include="..\..\src\utils\RALHashBase .pas"/>
195195 <DCCReference Include="..\..\src\utils\RALJson.pas"/>
196196 <DCCReference Include="..\..\src\utils\RALMD5.pas"/>
197197 <DCCReference Include="..\..\src\utils\RALMIMETypes.pas"/>
212212 <DCCReference Include="..\..\src\utils\RALStorageJSON.pas"/>
213213 <DCCReference Include="..\..\src\utils\RALStorageBIN.pas"/>
214214 <DCCReference Include="..\..\src\base\RALDBTypes.pas"/>
215+ <DCCReference Include="..\..\src\utils\RALHashes.pas"/>
215216 <BuildConfiguration Include="Base">
216217 <Key>Base</Key>
217218 </BuildConfiguration>
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ interface
1313
1414const
1515 // Versionamento
16- RALVERSION = ' 0.11.0-13 alpha' ;
16+ RALVERSION = ' 0.11.0-16 alpha' ;
1717 RALVERSION_MAJOR = 0 ;
1818 RALVERSION_MINOR = 11 ;
1919 RALVERSION_PATCH = 0 ;
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ class procedure TRALDB.ParseSQLParams(ASQL: StringRAL; AParams: TParams);
378378
379379 for vInt := POSINISTR to RALHighStr(ASQL) do
380380 begin
381- vSQLChar := ASQL[vInt];
381+ vSQLChar := CharRAL( ASQL[vInt]) ;
382382 if (vSQLChar = ' '' ' ) and (not vEspaceDoubleQuote) and
383383 (not (vEscapeQuote and (vChar = ' \' ))) then
384384 begin
Original file line number Diff line number Diff line change 1414 emCompressLibFilesError = ' The library files of the following classes were not found: %s.' ;
1515 emContentCheckError = ' Content check error.' ;
1616 emCryptEmptyKey = ' Key must be provided.' ;
17+ emHMACEmptyText = ' Input text must be provided.' ;
1718 emDBConnectionUndefined = ' Connection not set.' ;
1819 emDBDriverMissing = ' Connection driver not found.' ;
1920 emDBEmptyBody = ' Body is empty.' ;
Original file line number Diff line number Diff line change 1414 emCompressLibFilesError = ' No se encontraron los archivos binarios de biblioteca de las clases: %s.' ;
1515 emContentCheckError = ' Error de comprobación de contenido.' ;
1616 emCryptEmptyKey = ' Se debe proporcionar la clave.' ;
17+ emHMACEmptyText = ' Se debe proporcionar lo texto.' ;
1718 emDBConnectionUndefined = ' Conexión no establecida.' ;
1819 emDBDriverMissing = ' No se encontró el controlador de conexión.' ;
1920 emDBEmptyBody = ' El cuerpo está vacío.' ;
Original file line number Diff line number Diff line change 1414 emCompressLibFilesError = ' Os arquivos binários das seguintes classes não foram encontrados: %s.' ;
1515 emContentCheckError = ' Erro de verificação de conteúdo .' ;
1616 emCryptEmptyKey = ' A chave deve ser fornecida.' ;
17+ emHMACEmptyText = ' Texto de entrada não pode ser vazio.' ;
1718 emDBConnectionUndefined = ' Conexão não definida.' ;
1819 emDBDriverMissing = ' Driver de conexão não encontrado.' ;
1920 emDBEmptyBody = ' O " body" está vazio.' ;
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ TRALDBSQLDB = class(TRALDBBase)
3131 var ALastInsertId : Int64RAL); override;
3232 function GetDriverType : TRALDBDriverType; override;
3333 function GetFieldTable (ADataset: TDataSet; AFieldIndex: IntegerRAL) : StringRAL; override;
34- function OpenNative (ASQL : string ; AParams : TParams) : TDataset; override;
34+ function OpenNative (ASQL : StringRAL ; AParams : TParams) : TDataset; override;
3535 function OpenCompatible (ASQL : StringRAL; AParams : TParams) : TDataset; override;
3636
3737 procedure SaveToStream (ADataset: TDataSet; AStream: TStream;
@@ -127,7 +127,7 @@ destructor TRALDBSQLDB.Destroy;
127127 inherited Destroy;
128128end ;
129129
130- function TRALDBSQLDB.OpenNative (ASQL : string ; AParams : TParams) : TDataset;
130+ function TRALDBSQLDB.OpenNative (ASQL : StringRAL ; AParams : TParams) : TDataset;
131131var
132132 vQuery : TSQLQuery;
133133 vInt : integer;
Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ TRALBase64 = class
3737 class function GetSizeDecode (ASize: Int64RAL): Int64RAL;
3838 end ;
3939
40+ { $IF Defined(FPC) or Defined(DELPHIXE3UP)}
41+ TRALBase64StringHelper = record helper for StringRAL
42+ public
43+ function toBase64 : StringRAL;
44+ function fromBase64 : StringRAL;
45+ end ;
46+ { $IFEND}
47+
4048implementation
4149
4250const
@@ -71,6 +79,9 @@ class function TRALBase64.Decode(const AValue: StringRAL): StringRAL;
7179var
7280 vStream: TStream;
7381begin
82+ if AValue = ' ' then
83+ Raise Exception.Create(emHMACEmptyText);
84+
7485 vStream := StringToStreamUTF8(AValue);
7586 try
7687 Result := Decode(vStream);
@@ -340,6 +351,9 @@ class function TRALBase64.Encode(const AValue: StringRAL): StringRAL;
340351var
341352 vStream: TStream;
342353begin
354+ if AValue = ' ' then
355+ Raise Exception.Create(emHMACEmptyText);
356+
343357 vStream := StringToStreamUTF8(AValue);
344358 try
345359 Result := Encode(vStream);
@@ -419,4 +433,18 @@ class function TRALBase64.EncodeAsStream(AValue: TStream): TStream;
419433 Result.Position := 0 ;
420434end ;
421435
436+ { TRALBase64StringHelper }
437+
438+ { $IF Defined(FPC) or defined(DELPHIXE3UP)}
439+ function TRALBase64StringHelper.fromBase64 : StringRAL;
440+ begin
441+ Result := TRALBase64.Decode(Self);
442+ end ;
443+
444+ function TRALBase64StringHelper.toBase64 : StringRAL;
445+ begin
446+ Result := TRALBase64.Encode(Self);
447+ end ;
448+ { $IFEND}
449+
422450end .
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ interface
44
55uses
66 Classes, SysUtils,
7- RALHashes , RALTypes;
7+ RALHashBase , RALTypes;
88
99type
10- TRALCRC32 = class (TRALHashes )
10+ TRALCRC32 = class (TRALHashBase )
1111 private
1212 FCRC32 : LongWord;
1313 FBuffer: array [0 ..63 ] of Byte;
You can’t perform that action at this time.
0 commit comments