127 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
20 lines
994 B
C
20 lines
994 B
C
#ifndef GW_SOURCE_ACCOUNT_KEY_H
|
|
#define GW_SOURCE_ACCOUNT_KEY_H
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
/* Private local Source namespace, never a BattleTag or UI account. The same
|
|
* ASCII normalization is used by Source SRP. This identifier is not a secret,
|
|
* authorization token or replacement for the verified account/channel. */
|
|
static inline uint32_t gw_source_account_key(const char* name,size_t length){
|
|
static const char domain[]="WoWHybrid.local.SourceAccount.v1:";
|
|
uint64_t h=UINT64_C(14695981039346656037);size_t i;
|
|
if(!name || !length || length>32)return 0;
|
|
for(i=0;i<sizeof(domain)-1;++i){h^=(unsigned char)domain[i];h*=UINT64_C(1099511628211);}
|
|
for(i=0;i<length;++i){unsigned char c=(unsigned char)name[i];if(c<32 || c>126)return 0;
|
|
if(c>='a'&&c<='z')c=(unsigned char)(c-'a'+'A');
|
|
h^=c;h*=UINT64_C(1099511628211);}
|
|
{uint32_t key=(uint32_t)(h^(h>>32));return key?key:1;}
|
|
}
|
|
#define GW_SOURCE_INTERNAL_ACCOUNT_HIGH (UINT64_C(30)<<58)
|
|
#endif
|