Qore Programming Language Reference Manual  0.9.4.1
Pseudo_QC_Binary.dox.h
1 namespace Qore {
4 /***/
5 class <binary> : public <value> {
6 
7 public:
9 
21 bool empty();
22 
23 public:
25 
50 int find(data bin, softint byte_pos = 0);
51 
52 public:
54 
80 int rfind(data bin, softint byte_pos = -1);
81 
82 public:
84 
96 int size();
97 
98 public:
100 
109 bool sizep();
110 
111 public:
113 
129 list<binary> split(data sep);
130 
131 public:
133 
152 binary substr(softint start);
153 
154 public:
156 
176 binary substr(softint start, softint len);
177 
178 public:
180 
200 string toBase64(softint maxlinelen = -1);
201 
202 public:
204 
220 string toHex();
221 
222 public:
224 
248 string toMD5();
249 
250 public:
252 
274 string toSHA1();
275 
276 public:
278 
304 string toSHA224();
305 
306 public:
308 
334 string toSHA256();
335 
336 public:
338 
364 string toSHA384();
365 
366 public:
368 
394 string toSHA512();
395 
396 public:
398 
412 string toString(*string encoding);
413 
414 public:
416 
430 int typeCode();
431 
432 public:
434 
450 bool val();
451 };
452 };
<binary>::toSHA256
string toSHA256()
Returns the SHA-256 message digest (a variant of SHA-2) of the binary data as a hex string.
<binary>::typeCode
int typeCode()
Returns Qore::NT_BINARY.
<binary>::sizep
bool sizep()
Returns True since binary objects can return a non-zero size.
<binary>
Methods in this pseudo-class can be executed on binary values.
Definition: Pseudo_QC_Binary.dox.h:5
<binary>::toBase64
string toBase64(softint maxlinelen=-1)
Returns the base64-encoded representation of the binary object.
<binary>::substr
binary substr(softint start)
Returns a portion of the binary data starting from an integer offset.
<binary>::val
bool val()
Returns False if the binary object is empty (size = 0), True if not.
<binary>::size
int size()
Returns the number of bytes in the binary object.
<binary>::rfind
int rfind(data bin, softint byte_pos=-1)
Retrieves the byte position of a sequence of bytes within a binary object searching from the end of t...
<binary>::toSHA512
string toSHA512()
Returns the SHA-512 message digest (a variant of SHA-2) of the binary data as a hex string.
<binary>::find
int find(data bin, softint byte_pos=0)
Retrieves the byte position of a sequence of bytes within a binary object.
<binary>::toSHA384
string toSHA384()
Returns the SHA-384 message digest (a variant of SHA-2) of the binary data as a hex string.
<value>
Methods in this pseudo-class are available to be executed on any value type (even NOTHING); this is t...
Definition: Pseudo_QC_All.dox.h:5
<binary>::split
list< binary > split(data sep)
Returns a list of binary objects representing each component of the binary object separated by the by...
<binary>::toHex
string toHex()
returns a string of hexadecimal digits corresponding to the contents of the binary object; hex charac...
<value>::toString
string toString()
Returns the string representation of the value; the default is an empty string.
<binary>::toSHA1
string toSHA1()
Returns the SHA1 message digest of the binary data as a hex string.
<binary>::toSHA224
string toSHA224()
Returns the SHA-224 message digest (a variant of SHA-2) of the binary data as a hex string.
Qore
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
<binary>::empty
bool empty()
Returns True if the binary object is empty (size = 0), False if not.
<binary>::toMD5
string toMD5()
Returns the MD5 message digest of the binary data as a hex string.
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)