![]() |
Project
|
#include <cctype>#include <cstdint>#include <cmath>#include <cstdlib>#include <string>#include <random>#include <vector>#include <list>#include <memory>#include <fstream>#include <regex>#include <map>#include <functional>#include <utility>#include <sstream>#include <istream>#include <iomanip>#include <iterator>#include "DetectorsDCS/StringUtils.h"Go to the source code of this file.
Functions | |
| default_random_engine | gen (dev()) |
| uniform_int_distribution< long long > | uniform_dist (32, 126) |
| geometric_distribution< long long > | geom_dist (0.1) |
| constexpr uint64_t | MODULO (13835058055282163729ULL) |
| uint8_t | lookup (const char input) noexcept |
| uint64_t | exp (uint64_t base, uint8_t exp) noexcept |
| char | to_alpha_numeric (const uint8_t c) noexcept |
Variables | |
| random_device | dev |
| constexpr char | ALPHABET [39] |
| constexpr uint64_t | PRIMES [52] |
|
noexcept |
An all-integer exponent function. The orgiginal algorithm was submitted as an answer at StackOverflow, by Elias Yarrkow. The code was obtained from http://stackoverflow.com/a/101613 in 14 February 2017, 11:24, and modified to work with the unsigned C integer types. It is well-known that these kind of functions usually overflow, and overflows are ignored in this case.
| base | The base of the exponent function. |
| exp | The exponent. |
Definition at line 192 of file StringUtils.cxx.
| default_random_engine gen | ( | dev() | ) |
|
noexcept |
Transforms the given character into a 8-bit unsigned code symbol.
| input |
Definition at line 71 of file StringUtils.cxx.
|
constexpr |
The modulo used in the hash function after calculating the sum. It is the prime number closest to 1.5 * 2^63.
|
inlinenoexcept |
Definition at line 272 of file StringUtils.cxx.
|
constexpr |
Definition at line 40 of file StringUtils.cxx.
| random_device dev |
Definition at line 35 of file StringUtils.cxx.
|
constexpr |
The first 52 prime numbers used for calculating the hash code. Each symbol of the alias will be multiplied (mod 256) with a prime of the same index and adding the obtained number to the sum that is the hash code.
Definition at line 51 of file StringUtils.cxx.