// Copyright Low Entry. Apache License, Version 2.0. #pragma once #include "CoreMinimal.h" #include "LowEntryParsedHashcash.h" class ULowEntryHashingHashcashLibrary { private: constexpr static int32 VERSION = 1; constexpr static int32 MAX_COUNTER = 1048576; const static FString DATE_FORMAT_STRING; static TArray> BASE_64_CACHE; public: static TArray hashArray(const TArray& resource, const int32 bits); static TArray hashArrayCustomCreationDate(const TArray& resources, const FDateTime& date, const int32 bits); static FString hash(const FString& resource, const int32 bits); static FString hashCustomCreationDate(const FString& resource, const FDateTime& date, const int32 bits); static TArray parseArray(const TArray& Hashcashes); static ULowEntryParsedHashcash* parse(const FString& Hashcash); private: static TArray> GenerateBase64Cache(); static TArray base64WithoutLeadingZeroBytes(const int32 value); static FString getDateString(const FDateTime& date); static FDateTime parseDateString(const FString& date); FORCEINLINE static int32 countLeadingZeroBits(const TArray& values); FORCEINLINE static uint8 countLeadingZeroBits(const uint8 v); };