hb_B - Petewg/harbour-core GitHub Wiki

◀️Home ▢️ hb_C

  • 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 in C language.

  • hb_BitNot(<nVal>) ➜ nResult
    returns the bitwise complement of <nVal> (all bits are flipped), same as ~ operator in C language.

  • hb_BitOr(<nVal1>, <nVal2> [, <nVal3>, ... ]) ➜ nResult
    performs a bitwise OR operation, same as | operator in C language.

  • hb_BitReset(<nVal>, <nBit>) ➜ nResult
    returns the result of setting the bit <nBit> of <nVal> to 0. (<nBit> is ZERO based).

  • hb_BitSet(<nVal>, <nBit>) ➜ nResult
    returns the result of setting the bit <nBit> of <nVal> to 1 (<nBit> is ZERO based).

  • hb_BitShift(<nVal>, <nBits>) ➜ nResult
    returns <nVal> shifted <nBits> bits positions, equivalent of << and >> (LSHIFT/RSHIFT) operators in C.
    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 bitwise XOR operation, equivalent of ^ operator in C 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
    decrypts cCipher, using the key cBfKey, prepared with hb_blowfishKey().

  • hb_blowfishDecrypt_CFB(<cBfKey>, <cCipher> [, <cInitSeed> ]) ➜ cText or NIL
    decrypts cCipher, using the key cBfKey, 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
    encrypts cText, using the key cBfKey, prepared with hb_blowfishKey(). The optional lRaw 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 using CFB (cipher feedback) mode or NIL on error (e.g. wrong parameters).

  • hb_blowfishKey(<cPasswd>) ➜ cBfKey
    generates a key cBfKey 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 of n-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.

◀️Home ▢️ hb_C

⚠️ **GitHub.com Fallback** ⚠️