Hello This function is written using Pascal software. Someone can guide what this function does? Thanks ..
procedure int2Hex(intnum:integer; var Bytes:Tsb8); var b,b1,b2,b3,b4,b5,b6,b7,b8:byte; n:integer; begin n:= intnum; b:=n; b8:=b AND $0f; b7:=b AND $f0; b7:=b7 shr 4; n:=n shr 8; b:=n; b6:=b AND $0f; b5:=b AND $f0; b5:=b5 shr 4; n:=n shr 8; b:=n; b4:=b AND $0f; b3:=b AND $f0; b3:=b3 shr 4; n:=n shr 8; b:=n; b2:=b AND $0f; b1:=b AND $f0; b1:=b1 shr 4; end;
What I do know is that this function takes a number and stores it in an 8-byte array? But I do not know how he does it? I want to implement this function in C#. thanks for your help
public static byte [] getNibbles(UInt32 ui32) { const int Nibbles = 8; byte [] b = new byte[Nibbles]; for ( int n=0; n<Nibbles; ++n) { b[n] = (byte) (ui32 & 0xF); ui32 >>= 4; } return b; }
AND
shr
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)