mirror of
https://github.com/Relintai/pandemonium_engine_minimal.git
synced 2024-11-17 22:17:19 +01:00
40 lines
673 B
C++
40 lines
673 B
C++
#ifndef HASHING_CONTEXT_H
|
|
#define HASHING_CONTEXT_H
|
|
|
|
/* hashing_context.h */
|
|
|
|
|
|
#include "core/object/reference.h"
|
|
|
|
class HashingContext : public Reference {
|
|
GDCLASS(HashingContext, Reference);
|
|
|
|
public:
|
|
enum HashType {
|
|
HASH_MD5,
|
|
HASH_SHA1,
|
|
HASH_SHA256
|
|
};
|
|
|
|
private:
|
|
void *ctx;
|
|
HashType type;
|
|
|
|
protected:
|
|
static void _bind_methods();
|
|
void _create_ctx(HashType p_type);
|
|
void _delete_ctx();
|
|
|
|
public:
|
|
Error start(HashType p_type);
|
|
Error update(PoolByteArray p_chunk);
|
|
PoolByteArray finish();
|
|
|
|
HashingContext();
|
|
~HashingContext();
|
|
};
|
|
|
|
VARIANT_ENUM_CAST(HashingContext::HashType);
|
|
|
|
#endif // HASHING_CONTEXT_H
|