有谁能提供SHA1,Base64两个pas文件,本人愿意200分奉上

Sorder 2005-12-01 04:12:04
因为上述两个pas文件确实不容易找,
所以本人愿奉上200分求索
...全文
370 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
Sorder 2005-12-15
  • 打赏
  • 举报
回复
问题没有根本解决,决定在增加到50分
Sorder 2005-12-14
  • 打赏
  • 举报
回复
看来大家转述比较多阿
herman~~ 2005-12-09
  • 打赏
  • 举报
回复
不好意思,我也没那两个文件,只能帮顶了
ly_liuyang 2005-12-09
  • 打赏
  • 举报
回复
Cipher包的不是独立的,集成很多的
需要独立的,你就用ICS组件包吧
Sorder 2005-12-09
  • 打赏
  • 举报
回复
问题没有解决,请大家继续阿
Sorder 2005-12-05
  • 打赏
  • 举报
回复
大家不要光是说阿,
to y_liuyang(Liu Yang LYSoft http://lysoft.7u7.net)
Cipher包我前端时间就找到了,不过没有这两个单元,正式奇怪
ly_liuyang 2005-12-03
  • 打赏
  • 举报
回复
Cipher包就什么都有
N年前的经典,直到现在都是很好用的
budded 2005-12-03
  • 打赏
  • 举报
回复
LockBox,这是免费的代码哦
wizardqi 2005-12-03
  • 打赏
  • 举报
回复
这也200分??晕倒!
lzd123 2005-12-02
  • 打赏
  • 举报
回复
给个地址,我发给你
Sorder 2005-12-02
  • 打赏
  • 举报
回复
有谁能帮我读取到机子上有几个硬盘,有几个分区,那个分区分别所属那个硬盘的,
搞定的话我再加100分阿,谢谢各位大侠了
Sorder 2005-12-02
  • 打赏
  • 举报
回复
对不起阿,各位大侠
我引用这个文件后,系统提示”File not found:'Shal.inc'“
help!!!!!
Sorder 2005-12-02
  • 打赏
  • 举报
回复
to lzd123(昨夜清风)
xuelangling@sina.com.cn
我一样重分相谢

linzhengqun 2005-12-01
  • 打赏
  • 举报
回复
这里:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/winjab/winjab/Sha1.pas?rev=1.1
学会上Google找吗。
那两百分我有一半哦。
Sorder 2005-12-01
  • 打赏
  • 举报
回复
谢谢cuilj(一云忆水)
请问还有SHA1.pas 文件吗
g961681 2005-12-01
  • 打赏
  • 举报
回复
不是记得有直接的函数的啊~~~
leonkim 2005-12-01
  • 打赏
  • 举报
回复
unit uTBase64;

interface

uses sysUtils;

type
TBase64 = class(TObject)
private
FFilterDecodeInput: boolean;
function ValueToCharacter(Value: byte; var Character: char): boolean;
function CharacterToValue(Character: char; var Value: byte): boolean;
function FilterLine(InputData: string): string;
public
function EncodeData(InputData: string; var OutputData: string): byte;
function DecodeData(InputData: string; var OutputData: string): byte;
constructor Create;
published
property FilterDecodeInput: boolean read FFilterDecodeInput write FFilterDecodeInput;
end;

const
BASE64_OK = 0; // no errors, conversion successful
BASE64_ERROR = 1; // unknown error (e.g. can't encode octet in input stream) -> error in implementation
BASE64_INVALID = 2; // invalid characters in input string (may occur only when filterdecodeinput=false)
BASE64_LENGTH = 3; // input data length is not a Base64 length (mod 4)
BASE64_DATALEFT = 4; // too much input data left (receveived 'end of encoded data' but not end of input string)
BASE64_PADDING = 5; // wrong padding (input data isn't closed with correct padding characters)

implementation

const
AlphabetLength = 64;
Alphabet: string[AlphabetLength] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
Pad = '=';

{ TBase64 implementation}

constructor TBase64.Create;
begin
inherited Create;
FFilterDecodeInput := True;
end;

function TBase64.ValueToCharacter(Value: byte; var Character: char): boolean;
begin
Result := True;
if (Value > AlphabetLength-1) then Result := False
else Character := Alphabet[Value + 1];
end;

function TBase64.CharacterToValue(Character: char; var Value: byte): boolean;
begin
Result := True;
Value := Pos(Character, Alphabet);
if Value = 0 then Result := False
else Value := Value - 1;
end;

function TBase64.EncodeData(InputData: string; var OutputData: string): byte;
var
i, InputLength: integer;
CurrentB, PreviousB, c: Byte;
s: char;
begin
OutPutData := '';
InputLength := Length(InputData);
i := 1;
if InputLength = 0 then begin
Result := BASE64_OK;
Exit;
end;

repeat // process first group
CurrentB := Ord(InputData[i]);
Inc(i);
InputLength := InputLength - 1;
c := (CurrentB shr 2);
if not(ValueToCharacter(c, s)) then begin
Result := BASE64_ERROR;
Exit;
end;
OutPutData := OutPutData + s;
PreviousB := CurrentB;

// process second group
if InputLength = 0 then CurrentB := 0
else begin
CurrentB := Ord(InputData[i]);
Inc(i);
end;
InputLength := InputLength - 1;
c := (PreviousB and $03) shl 4 + (CurrentB shr 4);
if not(ValueToCharacter(c, s)) then begin
Result := BASE64_ERROR;
Exit;
end;
OutPutData := OutPutData + s;
PreviousB := CurrentB;

// process third group
if InputLength < 0 then s := pad
else begin
if InputLength = 0 then CurrentB := 0
else begin
CurrentB := Ord(InputData[i]);
Inc(i);
end;
InputLength := InputLength - 1;
c := (PreviousB and $0F) shl 2 + (CurrentB shr 6);
if not(ValueToCharacter(c, s)) then begin
Result := BASE64_ERROR;
Exit;
end;
end;
OutPutData := OutPutData + s;

// process fourth group
if InputLength < 0 then s := pad
else begin
c := (CurrentB and $3F);
if not(ValueToCharacter(c, s)) then begin
Result := BASE64_ERROR;
Exit;
end;
end;
OutPutData := OutPutData + s;

until InputLength <= 0;

Result := BASE64_OK;
end;

function TBase64.FilterLine(InputData: string): string;
var
f: byte;
i: integer;
begin
Result := '';
for i := 1 to Length(InputData) do
if CharacterToValue(InputData[i], f) or (InputData[i] = pad) then
Result := Result + InputData[i];
end;

function TBase64.DecodeData(InputData: string; var OutputData: string): byte;
var
i, InputLength: integer;
CurrentB, PreviousB, c: byte;
s: char;
begin
if InputData = '' then begin
Result := BASE64_OK;
Exit;
end;
OutPutData:='';

if FilterDecodeInput then InputData := FilterLine(InputData);

InputLength := Length(InputData);
if InputLength mod 4 <> 0 then begin
Result := BASE64_LENGTH;
Exit;
end;

i := 0;
repeat // process first byte
Inc(i);
s := InputData[i];
if not(CharacterToValue(s, CurrentB)) then begin
Result := BASE64_INVALID;
Exit;
end;
Inc(i);
s := InputData[i];
if not(CharacterToValue(s, PreviousB)) then begin
Result := BASE64_INVALID;
Exit;
end;

c := (CurrentB shl 2) + (PreviousB shr 4);
OutPutData := OutPutData + Chr(c);

// process second Byte
Inc(i);
s := InputData[i];
if s = pad then begin
if i <> InputLength-1 then begin
Result := BASE64_DATALEFT;
Exit; // too much data left
end else if InputData[i + 1] <> pad then begin
Result := BASE64_PADDING;
Exit;
end; // last char has to be a pad
end else begin
if not(CharacterToValue(s, CurrentB)) then begin
Result := BASE64_INVALID;
Exit;
end;
c := (PreviousB shl 4) + (CurrentB shr 2);
OutPutData := OutPutData + Chr(c);
end;

// process third Byte
Inc(i);
s := InputData[i];
if s = pad then begin
if i <> InputLength then begin
Result := BASE64_DATALEFT;
Exit;
end; // too much data Left
end else begin
if not(CharacterToValue(s, PreviousB)) then begin
Result := BASE64_INVALID;
Exit;
end;
c := (CurrentB shl 6) + (PreviousB);
OutPutData := OutPutData + Chr(c);
end;

until i >= InputLength;
Result := BASE64_OK;
end;

end.

5,379

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧