hb_B - Petewg/harbour-core GitHub Wiki
-
hb_base64Decode(
<cBase64Encoded>
) β cDecoded
decodes and returns a BASE64 encoded binary or string. -
hb_base64Encode(
<cData>, [<nLineLength>]
) β cBase64Encoded
encodes data into BASE64-encoded format. -
hb_BAt(
<cSubString>, <cString>, [<nFrom>], [<nTo>]
) β nPosition
returns the position number into<cString>
where the<cSubString>
is found, or zero if it is not found.
works like hb_At() but operates on byte/binary strings and is Code-Page independent. -
hb_BChar(
<nCode>
) β cText
returns an 1 byte string with<nCode>
value. -
hb_BCode(
<cText>
) β nCode
returns the value of the 1-st byte in a given<cText>
string. (code-page independent byte/binary operation)
-
hb_BitAnd(
<nVal1>, <nVal2> [, <nVal3>, ... ]
) β nResult
performs a bitwise AND operation, same as&
operator inC language
. -
hb_BitNot(
<nVal>
) β nResult
returns the bitwise complement of<nVal>
(all bits are flipped), same as~
operator inC
language. -
hb_BitOr(
<nVal1>, <nVal2> [, <nVal3>, ... ]
) β nResult
performs a bitwise OR operation, same as|
operator inC
language. -
hb_BitReset(
<nVal>, <nBit>
) β nResult
returns the result of setting the bit<nBit>
of<nVal>
to0
. (<nBit>
is ZERO based). -
hb_BitSet(
<nVal>, <nBit>
) β nResult
returns the result of setting the bit<nBit>
of<nVal>
to1
(<nBit>
is ZERO based). -
hb_BitShift(
<nVal>, <nBits>
) β nResult
returns<nVal>
shifted<nBits>
bits positions, equivalent of<<
and>>
(LSHIFT/RSHIFT) operators inC
.
If<nBits>
is a positive integer, bits are shifted to the left (LSHIFT), if is negative, bits are shifted to the right (RSHIFT). -
hb_BitTest(
<nVal>, <nBit>
) β lResult
returns .T. if the bit<nBit>
in<nVal>
is set. (<nBit>
is ZERO based). -
hb_BitXor(
<nVal1>, <nVal2> [, <nVal3>, ... ]
) β nResult
performs a bitwiseXOR
operation, equivalent of^
operator inC
language.
-
hb_BLeft(
<cString>, <nCount>
) β cSubstring -
hb_BLen(
<cText>
) β nBytes
return the length of<cText>
in bytes.
Unlike Len() function, hb_BLen() is codepage independent and returns, always, the same length for a given string. -
hb_blowfishDecrypt(
<cBfKey>, <cCipher> [, <lRaw>=.F. ]
) β cText or NIL
decryptscCipher
, using the keycBfKey
, prepared with hb_blowfishKey(). -
hb_blowfishDecrypt_CFB(
<cBfKey>, <cCipher> [, <cInitSeed> ]
) β cText or NIL
decryptscCipher
, using the keycBfKey
, prepared with hb_blowfishKey(), using CFB (cipher feedback) mode instead of ECB (electronic codebook). returns string decrypted or NIL on error (e.g. wrong parameters). -
hb_blowfishEncrypt(
<cBfKey>, <cText> [, <lRaw>]
) β cCipher or NIL
encryptscText
, using the keycBfKey
, prepared with hb_blowfishKey(). The optionallRaw
parameter, if set to TRUE (it is FALSE by default), disables ANSI X.923 padding but encode passed string in 8bytes blocks. If last block in string is smaller then it's padded to 8 bytes using Chr(0) and information about original string size is not attached to encrypted data. During decoding only strings which are well padded (N*8 bytes) are accepted and<lRaw> := .T.
disables restoring original string size encoded in encrypted string using ANSI X.923 standard, so the size of decrypted string is the same as original one.
NOTE: the size of encrypted data is padded to 64bit (8 bytes) so it's bigger than original one. -
hb_blowfishEncrypt_CFB(
<cBfKey>, <cText> [, <cInitSeed> ]
) β cCipher or NIL
return string encrypted usingCFB
(cipher feedback) mode orNIL
on error (e.g. wrong parameters). -
hb_blowfishKey(
<cPasswd>
) β cBfKey
generates a keycBfKey
from the passed password<cPasswd>
for use in the encryption/decryption functions. -
hb_BPadC(
<exp>, <nLength>, [<cFillChar>]
) β cPaddedString
same as 'PadC()', but binary (byte) oriented. -
hb_BPadL(
<exp>, <nLength>, [<cFillChar>]
) β cPaddedString
same as 'PadL()' (binary (byte) oriented). -
hb_BPadR(
<exp>, <nLength>, [<cFillChar>]
) β cPaddedString
same as 'PadR()' (binary (byte) operation). -
hb_BPeek(
<cText>, <n>
) β nCode
return value ofn-th
byte in given string. -
hb_BPoke(
[@]<cText>, <n>, <nVal>
) β cText
change n-th byte in given string to<nVal>
and return modified text. -
hb_BRAt(
<cSubString>, <cString>, [<nFrom>], [<nTo>]
) β nPosition
Same as hb_RAt() but for raw/binary strings. -
hb_BRight(
<cString>, <nCount>
) β cSubstring -
hb_BStuff(
<cString>, <nAt>, <nDel>, <cIns>
) β cResult -
hb_BSubStr(
<cString>, <nStart>, <nCount>
) β cSubstring -
hb_BuildDate() β cBuildDateTime
returns Harbour build DateTime in the form:MONTHNAME N YYYY HH:MM:SS
(f.e: May 5 2016 10:04:52) -
hb_ByteSwapI(
<nValue>
) β nNewValue
returns a 16 bits signed integer after swapping the two bytes of<nValue>
, considering it as a 16 bits number. e.g.: given a number with bytes (1,2) it will return it as (2,1). -
hb_ByteSwapL(
<nValue>
) β nNewValue
returns a 32 bits signed integer after swapping the four bytes of<nValue>
, considering it as a 32 bits number. e.g.: given a number with bytes (1,2,3,4) it will return it as (4,3,2,1). -
hb_ByteSwapLL(
<nValue>
) β nNewValue
same as 'hb_ByteSwapL()' but it works with 64 bits numbers. -
hb_ByteSwapU(
<nValue>
) β nNewValue
same as 'hb_ByteSwapL()' but returns a 32 bits unsigned integer. -
hb_ByteSwapW(
<nValue>
) β nNewValue
same as 'hb_ByteSwapI()' but returns a 16 bits unsigned integer. In both cases the binary representation of the returned value is exactly the same.