guess i have a bit HASH (HEX) and want to add 1
- Code: Select all Expand view
- 6965129d6c68406c93fa74c7ef2696b6 +1 -> ?
how can i do it
6965129d6c68406c93fa74c7ef2696b6 +1 -> ?
n := NUMTOHEX( 0x6965129d6c68406c93fa74c7ef2696b6 + 1 )
93FA74C7EF2696B7
function HexAddOne( cStr )
HB_INLINE( cStr ) {
char * text = ( char * ) hb_parc( 1 );
int iPos = hb_parclen( 1 );
char c = '0';
while ( iPos > 0 && c == '0' )
{
c = text[ --iPos ];
c = ( ( c == 'f' || c == 'F' ) ? '0' : ( c == '9' ? 'a' : c + 1 ) );
text[ iPos ] = c;
}
hb_ret();
}
return cStr
? c := hexaddone( "6965129d6c68406c93fa74c7ef2696b6" ) // --> 6965129d6c68406c93fa74c7ef2696b7
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 53 guests