reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Data.cxx File Reference
#include <algorithm>
#include "rutil/ResipAssert.h"
#include <chrono>
#include <ctype.h>
#include <fstream>
#include <math.h>
#include <limits>
#include <limits.h>
#include <random>
#include <stdexcept>
#include "rutil/Data.hxx"
#include "rutil/DataException.hxx"
#include "rutil/ParseBuffer.hxx"
#include "rutil/vmd5.hxx"
#include "rutil/Coders.hxx"
#include "rutil/WinLeakCheck.hxx"

Go to the source code of this file.

Macros

#define get16bits(d)
 
#define get32bits(d)   ((get16bits(d+2) << 16) + get16bits(d))
 
#define compUnalignedRemainder(d1, d2, size)
 

Functions

int hexpair2int (char high, char low)
 
bool urlNonEncodedCharsInitFn ()
 
Data bits (size_t v)
 
 HashValueImp (resip::Data, data.hash())
 

Variables

static const char hexmap [] = "0123456789abcdef"
 
static const signed char inversehexmap []
 
static const int Int32MaxSize = 11
 
static const int UInt64MaxSize = 20
 
static const int DoubleMaxSize = UInt64MaxSize + Data::MaxDigitPrecision
 
static const int CharMaxSize = 1
 
bool urlNonEncodedChars [256] = {false}
 
static bool dummy = urlNonEncodedCharsInitFn()
 
static const unsigned char randomPermutation [256]
 
static signed char base64Lookup [128]
 
static unsigned char codeCharUnsafe []
 
static unsigned char codeCharSafe []
 

Macro Definition Documentation

◆ compUnalignedRemainder

#define compUnalignedRemainder (   d1,
  d2,
  size 
)
Value:
switch(size) \
{\
case 3: \
if( (*d1 ^ *d2) & 0xDF) \
{ \
return false; \
} \
d1++; \
d2++; \
/* fallthrough */ \
case 2: \
if((get16bits(d1) ^ get16bits(d2)) & 0xDFDF) \
{ \
return false; \
} \
d1+=2; \
d2+=2; \
break; \
case 1: \
if( (*d1 ^ *d2) & 0xDF) \
{ \
return false; \
} \
d1++; \
d2++; \
/* fallthrough */ \
default: \
; \
}\
#define get16bits(d)
Definition Data.cxx:2227

Definition at line 2384 of file Data.cxx.

◆ get16bits

#define get16bits (   d)
Value:
((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\
+(uint32_t)(((const uint8_t *)(d))[0]) )
unsigned int uint32_t
Definition Stun.hxx:34
unsigned int uint32_t
Definition stdint.h:85
unsigned char uint8_t
Definition stdint.h:83

Definition at line 2227 of file Data.cxx.

◆ get32bits

#define get32bits (   d)    ((get16bits(d+2) << 16) + get16bits(d))

Definition at line 2238 of file Data.cxx.

Function Documentation

◆ bits()

Data bits ( size_t  v)

Definition at line 2342 of file Data.cxx.

◆ HashValueImp()

HashValueImp ( resip::Data  ,
data.  hash() 
)

◆ hexpair2int()

int hexpair2int ( char  high,
char  low 
)

Definition at line 83 of file Data.cxx.

◆ urlNonEncodedCharsInitFn()

bool urlNonEncodedCharsInitFn ( )

Definition at line 1383 of file Data.cxx.

Variable Documentation

◆ base64Lookup

signed char base64Lookup[128]
static
Initial value:
=
{
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,62,-1,62,-2,63,52,53,
54,55,56,57,58,59,60,61,-1,-1,
-1,-2,-1,-1,-1,0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10,11,12,13,14,
15,16,17,18,19,20,21,22,23,24,
25,-1,-1,-1,-1,63,-1,26,27,28,
29,30,31,32,33,34,35,36,37,38,
39,40,41,42,43,44,45,46,47,48,
49,50,51,-1,-1,-1,-1,-1
}

Definition at line 2590 of file Data.cxx.

◆ CharMaxSize

const int CharMaxSize = 1
static

Definition at line 604 of file Data.cxx.

◆ codeCharSafe

unsigned char codeCharSafe[]
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_."

Definition at line 2679 of file Data.cxx.

◆ codeCharUnsafe

unsigned char codeCharUnsafe[]
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="

Definition at line 2677 of file Data.cxx.

◆ DoubleMaxSize

const int DoubleMaxSize = UInt64MaxSize + Data::MaxDigitPrecision
static

Definition at line 440 of file Data.cxx.

◆ dummy

bool dummy = urlNonEncodedCharsInitFn()
static

Definition at line 1417 of file Data.cxx.

◆ hexmap

const char hexmap[] = "0123456789abcdef"
static

Definition at line 59 of file Data.cxx.

◆ Int32MaxSize

const int Int32MaxSize = 11
static

Definition at line 379 of file Data.cxx.

◆ inversehexmap

const signed char inversehexmap[]
static
Initial value:
= {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
-1, -1,
-1, -1, -1, -1, -1,
10, 11, 12, 13, 14, 15,
-1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1,
10, 11, 12, 13, 14, 15
}

Definition at line 61 of file Data.cxx.

◆ randomPermutation

const unsigned char randomPermutation[256]
static
Initial value:
=
{
44, 9, 46, 184, 21, 30, 92, 231, 79, 7, 166, 237, 173, 72, 91, 123,
212, 183, 16, 99, 85, 45, 190, 130, 118, 107, 169, 119, 100, 179, 251, 177,
23, 125, 12, 101, 121, 246, 61, 38, 156, 114, 159, 57, 181, 145, 198, 182,
58, 215, 174, 225, 82, 178, 150, 161, 63, 103, 32, 203, 68, 151, 139, 55,
143, 2, 36, 110, 209, 154, 204, 89, 62, 17, 187, 226, 31, 105, 195, 208,
49, 56, 238, 172, 37, 3, 234, 206, 134, 233, 19, 148, 64, 4, 10, 224,
144, 88, 93, 191, 20, 131, 138, 199, 243, 244, 39, 50, 214, 87, 6, 84,
185, 112, 171, 75, 192, 193, 239, 69, 106, 43, 194, 1, 78, 67, 116, 200,
83, 70, 213, 25, 59, 137, 52, 13, 153, 42, 232, 0, 133, 210, 76, 33,
255, 236, 124, 104, 65, 201, 53, 155, 140, 254, 54, 196, 120, 146, 216, 29,
28, 86, 245, 90, 98, 26, 81, 115, 180, 66, 102, 136, 167, 51, 109, 132,
77, 175, 14, 202, 222, 48, 223, 188, 40, 242, 157, 5, 128, 229, 71, 127,
164, 207, 247, 8, 80, 149, 94, 160, 47, 117, 135, 176, 129, 142, 189, 97,
11, 250, 221, 218, 96, 220, 35, 197, 152, 126, 219, 74, 170, 252, 163, 41,
95, 27, 34, 22, 205, 230, 241, 186, 168, 228, 253, 249, 113, 108, 111, 211,
235, 217, 165, 122, 15, 141, 158, 147, 240, 24, 162, 18, 60, 73, 227, 248
}

Definition at line 2006 of file Data.cxx.

◆ UInt64MaxSize

const int UInt64MaxSize = 20
static

Definition at line 382 of file Data.cxx.

◆ urlNonEncodedChars

bool urlNonEncodedChars[256] = {false}

Definition at line 1381 of file Data.cxx.