Registered StackHub users may elect to receive email notifications whenever a new package version is released or a comment is posted on the forum.
There are 2 watchers.
Encrypts the given function record by obfuscating the src
field.
passPhrase
is a seed string that's used to generate the actual runtimeKey
used to encrypt the axon source code.
Example:
{func, name:"fnName", src:"()=>69"}.afAxonEncryptor_encryptFunc("<passPhrase>")
Returns a Dict
which contains, amongst other fields, the runtime key needed to run the function.
By default, the encrypted source contains the runtimeKey
which is fine for obfuscation and general purpose use. Alternatively a keyFunc
may be passed in. The keyFunc
should either be a Str
of Axon code, or a Fn
that returns a Str
of Axon code, that when executed returns the runtimeKey
. Also see afAxonEncryptor_stackhubKeyFunc.
If keyFunc
is an Axon Fn it is called with two arguments: fnName
and runtimeKey
.
If not passed, the default options
are:
opts : {// If false, prevents the 'afAxonEncrypted' tag from being added to encrypted functions.addEncryptedTag : true,// The max number of characters in each line of cipher text.cipherSplit : 80,// Render cipher text as one multi-line Axon string. (Requires afAxonEncryptorRtExt 2.0.6+)multiLineCipher : false,// Encrypt Axon ComponentsencryptComps : true, }
Encrypts the given Trio file of Axon functions.
Example:
afAxonEncryptor_encryptTrioFile(`io/funcs.trio`, `io/build/`, "<passPhrase>")
trioFile
is the file to be encrypted.
passPhrase
is a seed string used to generate a runtimeKey
that is used to execute the encrypted source code.
Returns a Dict
which contains, amongst other fields, the runtime key needed to run the functions.
By default, the encrypted source contains the runtimeKey
which is fine for obfuscation and general purpose use. Alternatively a keyFunc
may be passed in. The keyFunc
should either be a Str
of Axon code, or a Fn
that returns a Str
of Axon code, that when executed returns the runtimeKey
. Also see afAxonEncryptor_stackhubKeyFunc.
If keyFunc
is an Axon Fn it is called with two arguments: fnName
and runtimeKey
.
If not passed, the default options
are:
opts : {// If false, prevents the 'afAxonEncrypted' tag from being added to encrypted functions.addEncryptedTag : true,// The max number of characters in each line of cipher text.cipherSplit : 80,// Render cipher text as one multi-line Axon string. (Requires afAxonEncryptorRtExt 2.0.6+)multiLineCipher : false,// Encrypt Axon ComponentsencryptComps : true, }
Returns a keyFunc
function that finds a valid StackHub licence for the given package (name and version) and returns the runtimeKey
property from that licence.
The returned keyFunc
can only be used with encryption functions.
Example:
keyFunc : afAxonEncryptor_stackhubKeyFunc("pkgName 1.0") encrypted : afAxonEncryptor_encryptTrioFile(`io/funcs.trio`, "<passPhrase>", keyFunc)