Skip to content

ReadFileAsHex (read file bytes)

ts
function ReadFileAsHex(what: string; offset, count: number): string;

This function reads count bytes, starting at offset position, from what file. The read bytes are returned as a hexadecimal (base16-encoded) string.

This function accepts the following parameters:

ParameterTypeRequirementExplanation
whatstringrequiredmust be a valid and existing path to a file you wish to read
offsetnumberrequiredthe starting byte from which the file should be read
countnumberrequiredthe number of bytes to read

Return value:

TypeExplanation
stringthe base16-encoded (hexadecimal) bytes read from the file