Loading...
Searching...
No Matches
gf_tabutil.cc File Reference
`#include "config.h"`
`#include "cf_assert.h"`
`#include "cf_defs.h"`
`#include "gf_tabutil.h"`

Go to the source code of this file.

## Functions

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

## Function Documentation

## conv62()

char conv62 | ( | int | i | ) |

Definition at line 22 of file gf_tabutil.cc.

{
if ( i < 10 )
return '0' + char(i);
else if ( i < 36 )
return 'A' + char(i-10);
else
return 'a' + char(i-36);
}
i
int i
Definition cfEzgcd.cc:132

## convback62()

int convback62 | ( | char | c | ) |

Definition at line 40 of file gf_tabutil.cc.

{
if ( c >= '0' && c <= '9' )
return int(c) - int('0');
else if ( c >= 'A' && c <= 'Z' )
return int(c) - int('A') + 10;
else
return int(c) - int('a') + 36;
}

## convert62()

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

Definition at line 32 of file gf_tabutil.cc.

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

## convertback62()

int convertback62 | ( | char * | p,
|  | int | n )

Definition at line 50 of file gf_tabutil.cc.

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

## gf_tab_numdigits62()

int gf_tab_numdigits62 | ( | int | q | ) |

Definition at line 12 of file gf_tabutil.cc.

{
if ( q < 62 )
return 1;
else if ( q < 62*62 )
return 2;
else
return 3;
}