Now layout build works fine

This commit is contained in:
2024-12-01 04:12:25 +03:00
parent 34bded906c
commit 42dc811cf6
28 changed files with 4040 additions and 2640 deletions

View File

@@ -460,4 +460,72 @@ String String::num_int64(int64_t p_num, int base, bool capitalize_hex) {
return s;
}
uint32_t String::hash(const char *p_cstr) {
uint32_t hashv = 5381;
uint32_t c;
while ((c = *p_cstr++)) {
hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
}
return hashv;
}
uint32_t String::hash(const char *p_cstr, int p_len) {
uint32_t hashv = 5381;
for (int i = 0; i < p_len; i++) {
hashv = ((hashv << 5) + hashv) + p_cstr[i]; /* hash * 33 + c */
}
return hashv;
}
uint32_t String::hash(const CharType *p_cstr, int p_len) {
uint32_t hashv = 5381;
for (int i = 0; i < p_len; i++) {
hashv = ((hashv << 5) + hashv) + p_cstr[i]; /* hash * 33 + c */
}
return hashv;
}
uint32_t String::hash(const CharType *p_cstr) {
uint32_t hashv = 5381;
uint32_t c;
while ((c = *p_cstr++)) {
hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
}
return hashv;
}
uint32_t String::hash() const {
/* simple djb2 hashing */
const CharType *chr = c_str();
uint32_t hashv = 5381;
uint32_t c;
while ((c = *chr++)) {
hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
}
return hashv;
}
uint64_t String::hash64() const {
/* simple djb2 hashing */
const CharType *chr = c_str();
uint64_t hashv = 5381;
uint64_t c;
while ((c = *chr++)) {
hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
}
return hashv;
}