* ``pread`` is the read dual of ``pwrite``; takes a length, an offset, and
a file name, and returns a base64-encoded blob. Be careful that length
is reasonable, to minimize heap usage.
+ * ``sha256`` reports the ASCII-fied hex of the file given, useful for
+ verification of flash contents.
* ``cert`` loads a file in its entirety and passes it to ``net.cert.verify``.
Be careful, as this can use a lot of heap.
end
, ["sha256"] = function(ll,s) -- compute the hash of a file in flash
local fn = string.match(ll,"^%s*([^%s]+)%s*$")
- s(crypto.toBase64(crypto.fhash('sha256',fn)))
+ s(crypto.tohex(crypto.fhash('sha256',fn)))
end
, ["pread"] = function(ll,s) -- read b64 data from off in fn
local len, off, fn = string.match(ll,"^%s*(%d+)%s+(%d+)%s+([^%s]+)%s*$")