kernels/linux-2.4.0/arch/ia64/sn/io/eeprom.c
/* Convert a standard ASCII serial number to a unique integer
 * id number by treating the serial number string as though
 * it were a base 36 number
 */
Convert a standard ASCII serial number to a unique integer
id number by treating the serial number string as though
it were a base 36 number
Convert a standard ASCII serial number to a unique integer id number by treating the serial number string as though it were a base 36 number
uint64_t generate_unique_id( char *sn, int sn_len )
{
    int uid = 0;
    int i;
    #define VALID_BASE36(c)	((c >= '0' && c <='9') \
			    ||   (c >= 'A' && c <='Z') \
			    ||   (c >= 'a' && c <='z'))
    for( i = 0; i < sn_len; i++ ) {
	if( !VALID_BASE36(sn[i]) )
	    continue;
	uid *= 36;
	uid += char_to_base36( sn[i] );
    }
    if( uid == 0 )
	return rtc_time();
    return uid;
}
uint64_t generate_unique_id ( char * sn , int sn_len ) { int uid = 0 ; int i ; #define VALID_BASE36 ( c ) 	((c >= '0' && c <='9') \
			    ||   (c >= 'A' && c <='Z') \
			    ||   (c >= 'a' && c <='z')) for ( i = 0 ; i < sn_len ; i ++ ) { if ( ! VALID_BASE36 ( sn [ i ] ) ) continue ; uid *= 36 ; uid += char_to_base36 ( sn [ i ] ) ; } if ( uid == 0 ) return rtc_time ( ) ; return uid ; }
Convert a standard ASCII serial number to a unique integer
 id number by treating the serial number string as though
 it were a base 36 number
Convert a standard ASCII serial number to a unique integer id number by treating the serial number string as though it were a base 36 number