Halaman

Minggu, 24 Juli 2011

Delphi : How to rotate bits?

Rotating bits using delphi is not directly supported
here is a function i found searching the internet to rotate the bits :
function JHROR32(Value : dword ; N : integer) : dword ;
begin
  Result := (Value shr N) + (Value shl (32-N));
end;

function JHROL32(Value : dword ; N : integer) : dword ;
begin
  Result := (Value shl N) + (Value shr (32-N));
end;
Hope you find it usefully! ;)

Source : http://www.merlyn.demon.co.uk/del-bits.htm

Tidak ada komentar:

Posting Komentar