{MkCRC - CRC-routines extracted from MkMisc - Copyright 1993 by Mark May - MK Software
 changes (c) 1999-2000 by Andre Grueneberg (2:2411/525;andre@grueneberg.de)
 changes (c) 1999-2001 by Oliver Kopp (2:2471/1464;olly98@users.sourceforge.net)
****************************************************************************
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
****************************************************************************}
(* $Id: mkcrc.pas,v 1.1 2001/04/01 22:26:46 olly98 Exp $ *)

unit MkCRC;

{$I MKB.Def}

interface

Function  StrCRC(Const Str: String): LongInt;
Function  NameCRC(Const Str: String): LongInt;

implementation

uses Crc32;

Function NameCRC(Const Str: String): LongInt;
  Var
    L: LongInt;

  Begin
  L := StrCrc(Str);
  If ((L >= 0) and (L < 16)) Then
    Inc(L,16);
  NameCrc := L;
  End;


Function StrCRC(Const Str: String): LongInt;
  Var
    Crc: LongInt;
    i: Word;

  Begin
  i := 1;
  Crc := $ffffffff;
  For i :=1 to Byte(Str[0]) Do
    Crc := UpdC32(Byte(UpCase(Str[i])),Crc);
  End;



end.

