Return TypeFunction nameArguments
voidWriteSerialUINT32(hzChain&,unsigned int&,unsigned int,)

Declared in file: hzCodec.h
Defined in file : hzCodec.cpp

Function Logic:

0:START 1:nValue<0x80 2:nLen hzChain::AddByte 3:nValue<0x2000 4:nLen hzChain::AddByte hzChain::AddByte 5:nValue<0x200000 6:nLen hzChain::AddByte hzChain::AddByte hzChain::AddByte 7:nValue<0x20000000 8:nLen hzChain::AddByte hzChain::AddByte hzChain::AddByte hzChain::AddByte 9:nLen hzChain::AddByte hzChain::AddByte hzChain::AddByte hzChain::AddByte hzChain::AddByte 10: No text

Function body:

void WriteSerialUINT32 (hzChain& Z, unsigned int& nLen, unsigned int nValue)
{
   if (nValue < 0x80)
   {
       nLen = 1;
       Z.AddByte(nValue & 0x7f);
   }
   else if (nValue < 0x2000)
   {
       nLen = 2;
       Z.AddByte(0x80+((nValue&0x1f00)>>8));
       Z.AddByte(nValue & 0xff);
   }
   else if (nValue < 0x200000)
   {
       nLen = 3;
       Z.AddByte(0xA0+((nValue&0x1f0000)>>16));
       Z.AddByte((nValue & 0xff00)>>8);
       Z.AddByte(nValue & 0xff);
   }
   else if (nValue < 0x20000000)
   {
       nLen = 4;
       Z.AddByte(0xC0+((nValue&0x1f000000)>>24));
       Z.AddByte((nValue & 0xff0000)>>16);
       Z.AddByte((nValue & 0xff00)>>8);
       Z.AddByte(nValue & 0xff);
   }
   else
   {
       nLen = 5;
       Z.AddByte(0xE0);
       Z.AddByte((nValue & 0xff000000)>>24);
       Z.AddByte((nValue & 0xff0000)>>16);
       Z.AddByte((nValue & 0xff00)>>8);
       Z.AddByte(nValue & 0xff);
   }
}