7 using s_t
= decltype(s_
);
9 std::uniform_int_distribution
<s_t
> uni_dist
;
12 auto resp
{b32_ndigits_
};
13 b32_str_
[resp
] = '\0';
15 // <http://philzimmermann.com/docs/human-oriented-base-32-encoding.txt>
17 constexpr char b32_charset
[]{"ybndrfg8ejkmcpqxot1uwisza345h769"};
19 auto const os
{reinterpret_cast<const unsigned char*>(&s_
)};
20 auto osp
{os
+ sizeof(s_
)};
23 switch ((osp
- os
) % 5) { // Duff's device
27 b32_str_
[--resp
] = b32_charset
[x
% 32];
32 x
|= (static_cast<unsigned long>(*--osp
)) << 3;
33 b32_str_
[--resp
] = b32_charset
[x
% 32];
35 b32_str_
[--resp
] = b32_charset
[x
% 32];
40 x
|= (static_cast<unsigned long>(*--osp
)) << 1;
41 b32_str_
[--resp
] = b32_charset
[x
% 32];
46 x
|= (static_cast<unsigned long>(*--osp
)) << 4;
47 b32_str_
[--resp
] = b32_charset
[x
% 32];
49 b32_str_
[--resp
] = b32_charset
[x
% 32];
54 x
|= (static_cast<unsigned long>(*--osp
)) << 2;
55 b32_str_
[--resp
] = b32_charset
[x
% 32];
57 b32_str_
[--resp
] = b32_charset
[x
];