commands/hash/hash.cif
author Tom Sutcliffe <thomas.sutcliffe@accenture.com>
Thu, 26 Aug 2010 00:49:35 +0100
changeset 45 534b01198c2d
parent 0 7f656887cf89
permissions -rw-r--r--
Added ENotifyKeypresses and ECaptureCtrlC flags to CCommandBase. Commands can now get keypresses and handle ctrl-C via callbacks instead of having to implement custom active objects. As part of this extended the CCommandBase extension interface to MCommandExtensionsV2 for the new virtual functions KeyPressed(TUint aKeyCode, TUint aModifiers) and CtrlCPressed(). sudo now cleans up correctly by using ECaptureCtrlC.

# hash.cif
# 
# Copyright (c) 2010 Accenture. All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
# 
# Initial Contributors:
# Accenture - Initial contribution
#

==name hash

==short-description

Calculate cryptographic hashes.

==long-description

Given some input data, caculates a corresponding number using one of several supported hashing algorithms. Hashing algorithms are designed to have a high likelihood of producing a significantly different number for even small differences in input data. As such, they are useful gaining a degree of certainly about whether a particular data set has changed without having to store the whole data set.

Reads data to be hashed either from a file or from STDIN. Writes the corresponding hash either to a file or to STDOUT. Supports a variety of different hashing algorithms.

Defaults to using the SHA1 algorithm if the '-a' option is not specified. This means that to create an hash file of an executable file stored on removable media (such that F32 will allow it to be loaded), run:

  hash -i <executable_file_name> -o c:\sys\hash\<executable_file_name>

==option bool v verbose

Verbose output.

==option filename i input

The name of the file whose data is to be hashed. If not specified, data is read from STDIN.

==option filename o output

The name of the file to write the hash to. If not specified, the hash is ASCII / hex dumped to STDOUT.

==option enum a algorithm

==enum-value SHA1

==enum-value MD2

==enum-value MD4

==enum-value MD5

==enum-value SHA224

==enum-value SHA256

==enum-value SHA384

==enum-value SHA512


==copyright

Copyright (c) 2009-2010 Accenture. All rights reserved.