My Project
Loading...
Searching...
No Matches
Functions
gf_tabutil.h File Reference

utility functions to access GF Tables More...

Go to the source code of this file.

Functions

int FACTORY_PUBLIC gf_tab_numdigits62 (int q)
 
char conv62 (int i)
 
void convert62 (int i, int n, char *p)
 
int convback62 (char c)
 
int FACTORY_PUBLIC convertback62 (char *p, int n)
 

Detailed Description

utility functions to access GF Tables

Definition in file gf_tabutil.h.

Function Documentation

◆ conv62()

char conv62 ( int  i)

Definition at line 22 of file gf_tabutil.cc.

23{
24 if ( i < 10 )
25 return '0' + char(i);
26 else if ( i < 36 )
27 return 'A' + char(i-10);
28 else
29 return 'a' + char(i-36);
30}
int i
Definition: cfEzgcd.cc:132

◆ convback62()

int convback62 ( char  c)

Definition at line 40 of file gf_tabutil.cc.

41{
42 if ( c >= '0' && c <= '9' )
43 return int(c) - int('0');
44 else if ( c >= 'A' && c <= 'Z' )
45 return int(c) - int('A') + 10;
46 else
47 return int(c) - int('a') + 36;
48}

◆ convert62()

void convert62 ( int  i,
int  n,
char *  p 
)

Definition at line 32 of file gf_tabutil.cc.

33{
34 for ( int j = n-1; j >= 0; j-- ) {
35 p[j] = conv62( i % 62 );
36 i /= 62;
37 }
38}
int p
Definition: cfModGcd.cc:4078
int j
Definition: facHensel.cc:110
char conv62(int i)
Definition: gf_tabutil.cc:22

◆ convertback62()

int FACTORY_PUBLIC convertback62 ( char *  p,
int  n 
)

Definition at line 50 of file gf_tabutil.cc.

51{
52 int r = 0;
53 for ( int j = 0; j < n; j++ )
54 r = r * 62 + convback62( p[j] );
55 return r;
56}
int convback62(char c)
Definition: gf_tabutil.cc:40

◆ gf_tab_numdigits62()

int FACTORY_PUBLIC gf_tab_numdigits62 ( int  q)

Definition at line 12 of file gf_tabutil.cc.

13{
14 if ( q < 62 )
15 return 1;
16 else if ( q < 62*62 )
17 return 2;
18 else
19 return 3;
20}