201
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Part
Description
sourcestr
String to convert.
Details
Recognizes &b (binary) and &h (hexadecimal) prefixes. Can be invoked implicitly,
through the dword_var= string_var expression (see example below). Compiler is
smart enough to pre-calculate constant-only expressions involving implicit use of
lval function.
Examples
dim
d
as
word
dim
l
as
long
dim
s
as
string
s =
"4294967295"
d = lval(s)
'explicit invocation, result will be 4294967295
l = lval(s)
'
d = s
'implicit invocation, result will be -1 (4294967295 -> &hFFFFFFFF ->
-1 for signed variable)
d =
"2402"
'be calculated at compilation -- no actual lval function
invokation will be here
Md5 Function
Function:
Generates MD5 hash on the str string.
Syntax:
md5(byref str as string,byref input_hash as string,
md5_mode as md5_modes,total_len as word) as
string
Returns:
16-character hash string; an empty string when invalid
str or input_hash argument was detected
See Also:
Part
Description
str
String containing (the next portion of) the input data to
generate MD5 hash on. When md5_mode= 0-
MD5_UPDATE, this string must be 64, 128, or 192
characters in length. Any other length will result in error
and the function will return an empty string. When
md5_mode= 1- MD5_FINISH, this string can have any
length (up to 255 bytes).
input_hash
Hash obtained as a result of MD5 calculation on the
previous data portion. Leave it empty for the first portion of
data. Use the result of MD5 calculation on the previous data
portion for the second and all subsequent portions of data.
The result of MD5 is always 16 characters long, so passing
the string of any other length (except 0 -- see above) will
result in error and this function will return an empty string.
205