PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBHashCTX
Wrapper Class for the IHashCTX interface.
#include <SFBHashCTX.h.hpp>
class SFBHashCTX : public SFBQuery;
SFMTYPEDEFWRAPPER(SFBHashCTX)

Inheritance diagram

 Inheritance diagram of SFBHashCTXClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IHashCTX

Member

Public Functions
SFCError Final( VoidPtr hash , SInt32 hashSize , VoidPtr result , SInt32Ptr resultSize )
Get the hashed result after all the calls to SFBHashCTX::Update().
SFCError Final( SFXBufferPtr hash , SFXBufferPtr result )
Get the hashed result after all the calls to SFBHashCTX::Update().
Void Init( VoidPtr hash , SInt32 hashSize )
Start or restart the hashing process.
Void Init( SFXBufferPtr hash )
Start or restart the hashing process.
static
SFBHashCTXSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBHashCTX instance.
Void Update( VoidPtr hash , SInt32 hashSize , VoidConstPtr data , SInt32 dataLength )
Feed data to the hash object.
Void Update( SFXBufferPtr hash , SFXBufferConstRef data )
Feed data to the hash object.
SFCError QueryInterface( AEECLSID clsid , VoidHandle handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFCError QueryInterface( AEECLSID clsid , SFBBaseSmpPtr handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFBBaseSmp QueryInterface( AEECLSID clsid ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
Void Self( AEECLSID clsidReq , SFBQuerySmpPtr clone , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SFBQuerySmp Self( AEECLSID clsidReq , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBHashCTX::Final
Get the hashed result after all the calls to SFBHashCTX::Update().
[ public ]
SFCError Final(
    VoidPtr hash           // pointer to a hash context structure
    SInt32 hashSize        // the size of the hash context structure 

    VoidPtr result         // pointer to the data to get the hashed result
    SInt32Ptr resultSize   // pointer to the size of the buffer Data. 
                           // on return, this contains the size of the hashed result
);
[ public ]
SFCError Final(
    SFXBufferPtr hash     // pointer to a hash context structure
    SFXBufferPtr result   // pointer to the data to get the hashed result.
                          // the size of the data can be modified automatically
);

Description

Warning: Buffer size can not over the limit of a SInt32 value.

Reference

BREW API IHASHCTX_Final


SFBHashCTX::Init
Start or restart the hashing process.
[ public ]
Void Init(
    VoidPtr hash      // pointer to a hash context structure
    SInt32 hashSize   // the size of the hash context structure
);
[ public ]
Void Init(
    SFXBufferPtr hash   // pointer to a hash context structure.
                        // if null, do nothing
);

Description

This is required if you need to hash new streams of data.

Reference

BREW API IHASHCTX_Init


SFBHashCTX::NewInstance
Create a new SFBHashCTX instance.
[ public, static ]
SFBHashCTXSmp NewInstance(
    AEECLSID id                    // ClassID for the Hash algorithm
    SFCErrorPtr exception = null   // Error
);

Description

The available ClassID is as below.

AEECLSID_MD2
AEECLSID_MD5
AEECLSID_SHA1


SFBHashCTX::Update
Feed data to the hash object.
[ public ]
Void Update(
    VoidPtr hash        // pointer to a hash context structure 
    SInt32 hashSize     // the size of the hash context structure 
    VoidConstPtr data   // pointer to the data to be hashed 
    SInt32 dataLength   // length of the data to be hashed(stored in data) 
);
[ public ]
Void Update(
    SFXBufferPtr hash        // pointer to a hash context structure
                             // if null,do nothing
    SFXBufferConstRef data   // pointer to the data to be hashed
);

Description

This function can be called multiple times to hash long streams or discontinous streams of data.

Reference

BREW API IHASHCTX_Update