Utilities
Decode QR Code
Decodes a base64-encoded jpeg to a UTF-8 string. POST only.
Request:
requestTypeisdecodeQRCodeqrCodeBase64is a base64-encoded jpeg string to be decoded
Response
qrCodeData(S) is a UTF-8 string containing the decoded data from the base64 stringrequestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Decode QR Code example.
Detect Mime Type
Gets the mime type of uploaded file or data.
Request:
requestTypeisdetectMimeTypedatais the data (optional)fileis the pathname of a data file to upload (optional ifdataprovided)filenameis a filename to associate withdata(optional iffileuploaded in which case the uploaded filename is always used)isTextisfalseifdatais a hex string (optional)
Response
type(S) is the mime typerequestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Detect Mime Type example.
Encode QR Code
Encodes a UTF-8 string to a base64-encoded jpeg. POST only.
Request:
requestTypeisencodeQRCodeqrCodeDatais a UTF-8 text string to be encodedwidthis the width of the output image (optional)heightis the height of the output image (optional)
Response
qrCodeBase64(S) is a base64 string encoding a jpeg image of the QR coderequestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Encode QR Code example.
Full Hash To Id
Converts a full hash to an ID.
Request:
requestTypeisfullHashToIdfullHashis the full hash 64-digit (32-byte) hex string
Response:
stringId(S) is the ID corresponding to the hash, in the form of an decimal stringlongId(S) is the signed long integer (8-bytes) representation of the ID used internally, returned as a stringrequestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Full Hash To Id example.
Hash
Calculates the hash of a secret for use in phased transactions with voting model 5 (Vote By Secret).
Request:
requestTypeishashhashAlgorithmis the hash function used:2for SHA256,3for SHA3,5for SCRYPT,6for RIPEMD160,25for Keccack25 and62for SHA256 followed by RIPEMD160, according to Get Constantssecretis a secret phrase in text form or hex string formsecretIsTextistrueifsecretis text,falseif it is a hex string (optional)
Note: secret is converted from a hex string to a byte array, which is what the hash algorithm expects, unless secretIsText is true, in which case secret is first converted from text to a UTF-8 hex string as by Hex Convert.
Response:
hash(S) is the hash of the secret, in the form of a hex stringrequestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Hash example.
Hex Convert
Converts a text string into a UTF-8 hex string and if the text input is already a hex string, also into text.
Request:
requestTypeishexConvertstringis a text string, possibly a hex string
Response:
binary(S) is the converted UTF-8 hex stringtext(S) is a text string converted fromstringif it is a valid UTF-8 hex stringrequestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Hex Convert example.
Long Convert
Converts an ID to the signed long integer representation used internally.
Request:
requestTypeislongConvertidis a numerical ID, in decimal form but equivalent to an 8-byte unsigned integer as produced by SHA-256 hashing
Response:
stringId(S) is the numerical IDlongId(S) is the signed long integer (8-bytes) representation of the ID used internally, returned as a stringrequestProcessingTime(N) is the API request processing time (in millisec)
Example: Refer to Long Convert example.
RS Convert
Get both the Reed-Solomon account address and the account number given an account ID.
Request:
requestTypeisrsConvertaccountis an account ID (either RS address or number)
Response:
accountRS(S) is the Reed-Solomon address of the accountrequestProcessingTime(N) is the API request processing time (in millisec)account(S) is the account number
Example: Refer to RS Convert example.