Is this the correct way to create a one byte LRC
- Code: Select all Expand view
- function MyLRC(text)
local ret:=left(text,1),x
for x = 2 to len(text)
ret:=chr(nXor( asc(ret), Asc(substr(text,x,1) ) ) )
next
return ret
function MyLRC(text)
local ret:=left(text,1),x
for x = 2 to len(text)
ret:=chr(nXor( asc(ret), Asc(substr(text,x,1) ) ) )
next
return ret
function LRC( cText )
local nCheckSum := 0
local n
for n = 1 to Len( cText )
nCheckSum = nXor( nCheckSum, Asc( SubStr( cText, n, 1 ) ) )
next
return nCheckSum
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 93 guests