Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Bstring Source Code
 previous   up   next 

Types
bstring
Type for byte strings.

bstring

const type: bstring

Type for byte strings.


Operator Summary
bstring
(attr bstring) parse (in string: stri)
Convert a string to a bstring value.
char
(in bstring: bstri) [ (in integer: index) ]
Get a character, identified by an index, from a bstring.
boolean
(in bstring: bstri1) = (in bstring: bstri2)
Check if two bstrings are equal.
boolean
(in bstring: bstri1) <> (in bstring: bstri2)
Check if two bstrings are not equal.

Function Summary
string
str (in bstring: bstri)
Convert a bstring value to a string.
integer
length (in bstring: bstri)
Determine the length of a bstring.
integer
hashCode (in bstring: bstri)
Compute the hash value of a bstring.
integer
compare (in bstring: bstri1, in bstring: bstri2)
Compare two bstrings.
bigInteger
bStriBe2BigInt (in bstring: bstri, in boolean: isSigned)
Convert a bstring (interpreted as big-endian) to a bigInteger.
bigInteger
bStriLe2BigInt (in bstring: bstri, in boolean: isSigned)
Convert a bstring (interpreted as little-endian) to a bigInteger.
bstring
bStriBe (in bigInteger: number, in boolean: isSigned)
Convert a bigInteger into a big-endian bstring.
bstring
bStriLe (in bigInteger: number, in boolean: isSigned)
Convert a bigInteger into a little-endian bstring.

Operator Detail

parse

const func bstring: (attr bstring) parse (in string: stri)

Convert a string to a bstring value.

Returns:
the bstring result of the conversion.
Raises:
RANGE_ERROR - When characters beyond '\255;' are present.
MEMORY_ERROR - Not enough memory to represent the result.

[

const func char: (in bstring: bstri) [ (in integer: index) ]

Get a character, identified by an index, from a bstring. The first character has the index 1.

Returns:
the character specified with the index.
Raises:
RANGE_ERROR - When the index is less than 1 or greater than the length of the bstring.

=

const func boolean: (in bstring: bstri1) = (in bstring: bstri2)

Check if two bstrings are equal.

Returns:
TRUE if both bstrings are equal, FALSE otherwise.

<>

const func boolean: (in bstring: bstri1) <> (in bstring: bstri2)

Check if two bstrings are not equal.

Returns:
FALSE if both bstrings are equal, TRUE otherwise.

Function Detail

str

const func string: str (in bstring: bstri)

Convert a bstring value to a string.

Returns:
the string result of the conversion.
Raises:
MEMORY_ERROR - Not enough memory to represent the result.

length

const func integer: length (in bstring: bstri)

Determine the length of a bstring.

Returns:
the length of the bstring.

hashCode

const func integer: hashCode (in bstring: bstri)

Compute the hash value of a bstring.

Returns:
the hash value.

compare

const func integer: compare (in bstring: bstri1, in bstring: bstri2)

Compare two bstrings.

Returns:
-1, 0 or 1 if the first argument is considered to be respectively less than, equal to, or greater than the second.

bStriBe2BigInt

const func bigInteger: bStriBe2BigInt (in bstring: bstri, in boolean: isSigned)

Convert a bstring (interpreted as big-endian) to a bigInteger.

Parameters:
bstri - Bstring to be converted. The bytes are interpreted as binary big-endian representation with a base of 256.
isSigned - Defines if bstri is interpreted as signed value. When isSigned is TRUE the twos-complement representation is used. In this case the result is negative when the most significant byte (the first byte) has an ordinal >= 128.
Returns:
a bigInteger created from the big-endian bytes.

bStriLe2BigInt

const func bigInteger: bStriLe2BigInt (in bstring: bstri, in boolean: isSigned)

Convert a bstring (interpreted as little-endian) to a bigInteger.

Parameters:
bstri - Bstring to be converted. The bytes are interpreted as binary little-endian representation with a base of 256.
isSigned - Defines if bstri is interpreted as signed value. When isSigned is TRUE the twos-complement representation is used. In this case the result is negative when the most significant byte (the last byte) has an ordinal >= 128.
Returns:
a bigInteger created from the little-endian bytes.

bStriBe

const func bstring: bStriBe (in bigInteger: number, in boolean: isSigned)

Convert a bigInteger into a big-endian bstring. The result uses binary representation with a base of 256.

Parameters:
number - BigInteger number to be converted.
isSigned - Determines the signedness of the result. When isSigned is TRUE the result is encoded with the twos-complement representation. In this case a negative number is converted to a result where the most significant byte (the first byte) has an ordinal >= 128.
Returns:
a bstring with the big-endian representation.
Raises:
RANGE_ERROR - When number is negative and isSigned is FALSE.
MEMORY_ERROR - Not enough memory to represent the result.

bStriLe

const func bstring: bStriLe (in bigInteger: number, in boolean: isSigned)

Convert a bigInteger into a little-endian bstring. The result uses binary representation with a base of 256.

Parameters:
number - BigInteger number to be converted.
isSigned - Determines the signedness of the result. When isSigned is TRUE the result is encoded with the twos-complement representation. In this case a negative number is converted to a result where the most significant byte (the last byte) has an ordinal >= 128.
Returns:
a bstring with the little-endian representation.
Raises:
RANGE_ERROR - When number is negative and isSigned is FALSE.
MEMORY_ERROR - Not enough memory to represent the result.


 previous   up   next