5 using s_t
= decltype(s_
);
7 std::uniform_int_distribution
<s_t
> uni_dist
;
10 auto resp
{b32_ndigits_
};
11 b32_str_
[resp
] = '\0';
13 // <http://philzimmermann.com/docs/human-oriented-base-32-encoding.txt>
15 constexpr char b32_charset
[]{"ybndrfg8ejkmcpqxot1uwisza345h769"};
17 auto const os
{reinterpret_cast<const unsigned char*>(&s_
)};
18 auto osp
{os
+ sizeof(s_
)};
21 switch ((osp
- os
) % 5) { // Duff's device
25 b32_str_
[--resp
] = b32_charset
[x
% 32];
30 x
|= (static_cast<unsigned long>(*--osp
)) << 3;
31 b32_str_
[--resp
] = b32_charset
[x
% 32];
33 b32_str_
[--resp
] = b32_charset
[x
% 32];
38 x
|= (static_cast<unsigned long>(*--osp
)) << 1;
39 b32_str_
[--resp
] = b32_charset
[x
% 32];
44 x
|= (static_cast<unsigned long>(*--osp
)) << 4;
45 b32_str_
[--resp
] = b32_charset
[x
% 32];
47 b32_str_
[--resp
] = b32_charset
[x
% 32];
52 x
|= (static_cast<unsigned long>(*--osp
)) << 2;
53 b32_str_
[--resp
] = b32_charset
[x
% 32];
55 b32_str_
[--resp
] = b32_charset
[x
];