Subject:
cnvcl的base64单元
[Print This Page]
Author:
npc8
Time:
2016-4-29 16:55
Subject:
cnvcl的base64单元
function Base64Encode(InputData: TStream; var OutputData: string): Byte; overload;
var
Str: TStringStream;
begin
Str := TStringStream.Create('');
try
Str.CopyFrom(InputData, InputData.Size);
Result := Base64Encode({$IFDEF UNICODE}AnsiString{$ENDIF}(Str.DataString), OutputData);
finally
Str.Free;
end;
end;
InputData中间如果某些byte是$00 会影响Str.DataString,继而出现加密错误
Author:
Passion
Time:
2016-5-3 10:05
我查查。
Author:
Passion
Time:
2016-5-3 16:56
已修正。并增加了一个允许传入内存块指针与长度的方法进行Encode。麻烦从git上更新一下最新代码?
Welcome to CnPack Forum (http://bbs.cnpack.org/)
Powered by Discuz! 5.0.0