npHash plugin

About this plugin

This plugin allow you to calculate the MD5, SHA1, SHA256, SHA384 and SHA512 algorithms of strings and files in a easy way and with all control of the task using the appropiate hash calculation events. The plugin inform you when hash calculation begin, end, is working, is aborted, etc. Also allow you to calculate more than one string and file hashes at the same time.

The MD5, SHA1, SHA256, SHA384 and SHA512 hashes can be useful in your publications to identify certain strings or files, for example. And of course you can use this plugin to compare provided MD5 and other hashes. All without thirdparty dependencies using native Windows API functions.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npHashCreate

This action creates a new instance of an Hash object. The result variable store the ID of the new Hash object. You can use this ID with other plugin actions.

↑↑

npHashDestroy

This action destruct a previously created Hash object instance. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npHashDestroyAll

This action destruct all previously created Hash object instances.

↑↑

npHashFile

Get the selected hash algorithm of the provided file. The result variable store the file hash, or "False" if an error occur. See the [LastError] in this last case.

Remember that before you use this action, is possible to set existing NeoBook subroutines to be execute on some hash calculation events. This is useful when treat with larger files.

↑↑

npHashString

Get the selected hash algorithm of the provided string. The result variable store the string hash, or "False" if an error occur. See the [LastError] in this last case.

Remember that before you use this action, is possible to set existing NeoBook subroutines to be execute on some hash calculation events.

↑↑

npHashAbort

Use this action to abort a currently working hash calculation. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npHashIsWorking

Find if any hash calculation is working. Store in the result variable "True" if any calculation is working, or "False" in any other case. The [LastError] variable can contain information about some error if occur.

↑↑

npOnHashWork

Set an optional NeoBook subroutine to be execute while a hash calculation are in progress. The instance variable contain the Hash object instance that fire the event. Store in the progress variable the number of bytes yet processed. The [LastError] variable can contain information about some error if occur. See also npOnHashWorkBegin,

↑↑

npOnHashWorkBegin

Set an optional NeoBook subroutine to be execute when a hash calculation has begin. The instance variable contain the Hash object instance that fire the event. Store in the max progress variable the total of bytes that must be processed. The [LastError] variable can contain information about some error if occur. See also npOnHashWork

↑↑

npOnHashWorkEnd

Set an optional NeoBook subroutine to be executed when a hash calculation has well end. The instance variable contain the Hash object instance that fire the event. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npOnHashAbort

Set an optional NeoBook subroutine to be executed when a hash calculation has aborted. The instance variable contain the Hash object instance that fire the event. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npOnHashError

Set an optional NeoBook subroutine to be executed in the rarelly case that a error is found while the hash calculation. The instance variable contain the Hash object instance that fire the event. Store in the error variable the found Windows error. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

Action errors subroutine

All the NeoPlugins deal with errors in the same way that NeoBook does: when the plugin found an action error the [LastError] variable store information about the error, so you can take care about this variable when execute an action.

But all the NeoPlugins also incorporate an advanced way to deal with possible action errors. You can define a subroutine named OnNeoPluginActionError in order to be executed when some action error are found and you can use this variables inside:

Note that this error handling subroutine are shared for all the NeoPlugins, so you no need to specify a subroutine for every plugin you use in your publication because the same subroutine are recognized and automagically used by every NeoPlugin. Below you can view a sample of this subroutine code:

:OnNeoPluginActionError
  AlertBox "NeoPlugin Error" "Error [LastError] in plugin: [PluginName]"
Return

Also note that the use of this NeoPlugins error handling subroutine is completelly optional. You can continue using the [LastError] variable as usual and even use the both methods at the same time.

↑↑