xxhash64-php.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #define FFI_LIB "libxxhash.so"
  2. typedef enum { XXH_OK=0, XXH_ERROR } XXH_errorcode;
  3. typedef uint32_t XXH32_hash_t;
  4. typedef uint64_t XXH64_hash_t;
  5. struct XXH64_state_s {
  6. XXH64_hash_t total_len;
  7. XXH64_hash_t v1;
  8. XXH64_hash_t v2;
  9. XXH64_hash_t v3;
  10. XXH64_hash_t v4;
  11. XXH64_hash_t mem64[4];
  12. XXH32_hash_t memsize;
  13. XXH32_hash_t reserved32; /* required for padding anyway */
  14. XXH64_hash_t reserved64; /* never read nor write, might be removed in a future version */
  15. }; /* typedef'd to XXH64_state_t */
  16. typedef struct XXH64_state_s XXH64_state_t;
  17. extern XXH64_hash_t XXH64 (const void* input, size_t length, XXH64_hash_t seed);
  18. extern XXH64_state_t* XXH64_createState(void);
  19. extern XXH_errorcode XXH64_freeState(XXH64_state_t* statePtr);
  20. extern void XXH64_copyState(XXH64_state_t* dst_state, const XXH64_state_t* src_state);
  21. extern XXH_errorcode XXH64_reset (XXH64_state_t* statePtr, XXH64_hash_t seed);
  22. extern XXH_errorcode XXH64_update (XXH64_state_t* statePtr, const void* input, size_t length);
  23. extern XXH64_hash_t XXH64_digest (const XXH64_state_t* statePtr);
  24. typedef struct { unsigned char digest[8]; } XXH64_canonical_t;
  25. extern void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t hash);
  26. extern XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src);