MODULE CryptoHashes;
TYPE
Hash* = OBJECT
VAR
name-: ARRAY 64 OF CHAR;
size-: LONGINT;
initialized*: BOOLEAN;
PROCEDURE &Init*;
BEGIN
initialized := FALSE
END Init;
PROCEDURE Initialize*;
BEGIN
HALT(301)
END Initialize;
PROCEDURE SetNameAndSize*( CONST name: ARRAY OF CHAR; size: LONGINT );
BEGIN
COPY( name, SELF.name );
SELF.size := size
END SetNameAndSize;
PROCEDURE Update*( CONST data: ARRAY OF CHAR; ofs, len: LONGINT );
BEGIN
HALT(301)
END Update;
PROCEDURE GetHash*( VAR buffer: ARRAY OF CHAR; position: LONGINT );
BEGIN
HALT(301)
END GetHash;
END Hash;
HashFactory = PROCEDURE( ): Hash;
PROCEDURE NewHash*( CONST modname: ARRAY OF CHAR ): Hash;
VAR hash : Hash; factory : HashFactory;
BEGIN
ASSERT( LEN( modname ) < 57 );
hash := NIL;
GETPROCEDURE( modname, "NewHash", factory );
IF factory # NIL THEN
hash := factory();
END;
RETURN hash;
END NewHash;
END CryptoHashes.
System.Free CryptoHashes~