JMP can also handle binary (large) objects, commonly called BLOBs. The functions below convert between hexadecimal values, numbers, characters, and BLOBs. Some of the functions are covered in more detail following Hexadecimal and BLOB Functions.
Hex("text")
Hex("num")
Hex("blob")
|
Char To Hex is an alias.
|
Hex To Blob("hexstring")
|
|
The default encoding for the character string is utf-8. utf-16le, utf-16be, us-ascii, iso-8859-1, ascii~hex, shift-jis, and euc-jp are also supported.
|
|
Char To Blob("string")
|
The default encoding for the blob is utf-8. utf-16le, utf-16be, us-ascii, iso-8859-1, ascii~hex, shift-jis, and euc-jp are also supported.
|
Blob To Char("blob")
|
The default encoding for the character string is utf-8. utf-16le, utf-16be, us-ascii, iso-8859-1, ascii~hex, shift-jis, and euc-jp are also supported.
|
Returns a new BLOB that is a subset of the given BLOB that is length bytes long and begins at the offset. Note that the offset is 0-based.
|
Hex(string) returns the hexadecimal codes for each character in the argument. For example,
Hex( "Abc" );
Hex to Char(string) converts hexadecimal to characters. The resulting character string might not be valid display characters. All the characters must be in pairs, in the ranges 0-9, A-Z, and a-z. Blanks and commas are allowed, and skipped. For example,
Hex To Char( "4142" );
Hex and Hex To Char are inverses of each other, so
Hex To Blob(string) takes a string of hexadecimal codes and converts it to a binary object.
Show( a );
Blob Peek(blob,offset,length) extracts bytes as defined by the arguments from a blob.
Show( b );
Show( b );
Show( b );
Hex(blob) converts a blob into hexadecimal.
c = Hex( a );
Show( c );
d = Hex To Char( c );
Show( d );
Concat(blob1,blob2) or blob1 || blob2 concatenates two blobs.
Show( e );
Show( f );
Length(blob) returns the number of bytes in a blob.
g = Length( f );
Show( g );
注意:When blobs are listed in the log, they are shown with the constructor function Char To Blob("...").
Any hex code outside the ASCII range (space to }, or hex 20 - 7D) is encoded as the three-character sequence [~][hexdigit][hexdigit]. For example,
Show( h );
i = Hex( h );
Show( i );
Char To Blob(string) creates a blob from a string, converting ~hex codes. Blob To Char(blob) creates a string with ~hex codes to indicate non-visible and non-ASCII codes.
|