Listing 1.1
First Level Encoding


#ifndef uchar
#define uchar unsigned char
#endif /* uchar */
  
uchar *L1_Encode( uchar *dst, const uchar *name )
  {
  int i = 0;
  int j = 0;

  /* Encode the name. */
  while( ('\0' != name[i]) && (i < 16) )
    {
    dst[j++] = 'A' + ((name[i] & 0xF0) >> 4);
    dst[j++] = 'A' + (name[i++] & 0x0F);
    }

  /* Encode the padding bytes. */
  while( j < 32 )
    {
    dst[j++] = 'C';
    dst[j++] = 'A';
    }

  /* Terminate the string. */
  dst[32] = '\0';

  return( dst );
  } /* L1_Encode */


$Revision: 1.12 $
$Date: 2003/02/18 21:43:58 $
[W3C Validated] Copyright © 1999-2003 Christopher R. Hertel 
Released under the terms of the LGPL