Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libfsst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ vector<const u8*> makeSample(u8* sampleBuf, const u8* strIn[], const size_t **le
for(size_t i=0; i<nlines; i++)
sample.push_back(strIn[i]);
} else {
size_t sampleRnd = FSST_HASH(4637947);
u64 sampleRnd = FSST_HASH(4637947);
const u8* sampleLim = sampleBuf + FSST_SAMPLETARGET;
size_t *sampleLen = new size_t[nlines + FSST_SAMPLEMAXSZ/FSST_SAMPLELINE];
*lenRef = sampleLen;
Expand Down
4 changes: 2 additions & 2 deletions libfsst.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ struct Symbol {
u16 first2() const { assert( length() >= 2); return 0xFFFF & load_num(); }

#define FSST_HASH_LOG2SIZE 10
#define FSST_HASH_PRIME 2971215073LL
#define FSST_HASH_PRIME 2971215073ULL
#define FSST_SHIFT 15
#define FSST_HASH(w) (((w)*FSST_HASH_PRIME)^(((w)*FSST_HASH_PRIME)>>FSST_SHIFT))
size_t hash() const { size_t v = 0xFFFFFF & load_num(); return FSST_HASH(v); } // hash on the next 3 bytes
u64 hash() const { u64 v = 0xFFFFFF & load_num(); return FSST_HASH(v); } // hash on the next 3 bytes
};

// Symbol that can be put in a queue, ordered on gain
Expand Down