Sponsored Content
Top Forums Shell Programming and Scripting List all files with prepended CRC32 (or other) hash code? Post 302560894 by pstein on Sunday 2nd of October 2011 05:44:58 AM
Old 10-02-2011
Quote:
Originally Posted by scottn
Code:
$ find . -type f | xargs crc32
8ffca073    ./Dir1/file3
6734ef32    ./Dir2/file4
2b985a52    ./file1
ea7784a8    ./file2

Thank you but this gives me (under Ubuntu 11.04) the following error:

Code:
xargs: crc32: No such file or directory

I assume crc32 and/or xargs is not available here.
Any other solution?

Peter

Last edited by radoulov; 10-02-2011 at 07:12 AM.. Reason: Code tags.
 

10 More Discussions You Might Find Interesting

1. Programming

crc32 info

hello again, does anyone know where i can find some detailed info about the cyclic redundancy check? thx (2 Replies)
Discussion started by: crashnburn
2 Replies

2. Shell Programming and Scripting

getting data list into a hash array

Begginer alert!! I have just started learning perl and have got stuck. I need to initialize a hash array with values from a list. I've been told to do this using a split command, but its just not happening. Here is the script and output: SCRIPT: #!/bin/perl system("clear"); ... (5 Replies)
Discussion started by: topcat8
5 Replies

3. Shell Programming and Scripting

Print Entire hash list (hash of hashes)

I have a script with dynamic hash of hashes , and I want to print the entire hash (with all other hashes). Itried to do it recursively by checking if the current key is a hash and if yes call the current function again with refference to the sub hash. Most of the printing seems to be OK but in... (1 Reply)
Discussion started by: Alalush
1 Replies

4. UNIX for Advanced & Expert Users

cksum's and zip's CRC32 algorithm

Hello! For long I used cksum to find file duplicates in linux and darwin. Now I want to make my own program that does all. However I can't seem to find the correct algorithm. zip and cksum claim to use the same algorithm, but the computated sums are not the same. I've already written an... (4 Replies)
Discussion started by: regnevakrad
4 Replies

5. Shell Programming and Scripting

Perl Hash:Can not keep hash data in the same order that it was inserted

Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below. #!/usr/bin/perl use warnings; use Tie::IxHash; use strict; tie (my %programs, "Tie::IxHash"); while (my $line = <DATA>) { chomp $line; my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies

6. UNIX for Dummies Questions & Answers

cksum does not give me crc32

Is cksum the right command to calculate the crc32 checksum value? I tried it for a number of files now and every time the results dont match. So there is nothing wrong with the file. Also, cksum gives me an all numerical value while crc32 is alpha numeric. What am I doing wrong? Thanks (9 Replies)
Discussion started by: utamav
9 Replies

7. Shell Programming and Scripting

Perl: Sorting a hash value that is a list.

Hi Folks I am very much a newbie at perl but picking it up and I'm hoping you can help. I have a file input that details all the /etc/group files in our enterprise in the following format: "<host>:<group>:<gid>:<users>" I want to parse this data display it as the following:... (9 Replies)
Discussion started by: g_string
9 Replies

8. Shell Programming and Scripting

Need to simplify code list files in directory

I have the following code that print certain files in my directory and groups things together. I would be good to tidy and simplify this code up and would greatly appreciate suggestions. if ($opt_raytrac == 1) then echo "" echo -n "\033*\)/ & /g' | sort -k 4n | sed 's/ //g' \ # |... (0 Replies)
Discussion started by: kristinu
0 Replies

9. Shell Programming and Scripting

Compare values of hashes of hash for n number of hash in perl without sorting.

Hi, I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all . my %result ( $abc => { 'data_count' => '10', 'ID' => 'ABC122', } $def => { 'data_count' => '20', 'ID' => 'defASe', ... (1 Reply)
Discussion started by: asak
1 Replies

10. Shell Programming and Scripting

Dynamically parse BibTeX and create hash of hash

Hello gurus, Iam trying to parse following BibTex file (bibliography.bib): @book{Lee2000a, abstract = {Abstract goes here}, author = {Lee, Wenke and Stolfo, Salvatore J}, title = {{Data mining approaches for intrusion detection}}, year = {2000} } @article{Forrest1996, abstract =... (0 Replies)
Discussion started by: wakatana
0 Replies
RHASH(1)							   User Manuals 							  RHASH(1)

NAME
rhash - calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other hash sums. SYNOPSIS
rhash [ option ]... [ file ]... DESCRIPTION
RHash (Recursive Hasher) computes and verifies various message digests (hash sums) of files. Supported message digests include CRC32, MD4, MD5, SHA1, SHA256, SHA512, Tiger, DC++ TTH, BitTorrent BTIH, AICH, ED2K, GOST R 34.11-94, RIPEMD-160, HAS-160, EDON-R 256/512, Whirlpool, Snefru-128/256. The program can create and verify Magnet links and eDonkey ed2k:// links, see --magnet and --ed2k-link options. A dash string parameter `-' is interpreted as stdin file. By default rhash prints sums in SFV format with CRC32 hash sum only. The format can be changed by options --bsd, --magnet, --simple, --printf, --template. To output all sums use the `-a' option. The default output format can also be changed by renaming the program or placing a hardlink/symlink to it with a name containing strings `crc32', `md4', `md5', `sha1', `sha256' `sha512', `tiger', `tth', `btih', `aich', `ed2k', `ed2k-link', `gost', `gost-cryptopro', `ripemd160', `has160', `whirlpool', `edonr256', `edonr512', `snefru128', `snefru256', `sfv' or `magnet'. PROGRAM MODE OPTIONS
The default mode is to print hash sums for all files and directory trees specified by command line. The mode can be set by the following options. -c, --check Check hash files specified by command line. RHash can verify hash files in SFV and BSD formats, standard MD5 and SHA1 files, and text files containing magnet or ed2k links (one link per line). Empty lines and lines starting with `;' or `#' are skipped. In fact RHash can verify most hash files generated by itself without formating options --printf and --template. -u, --update Update hash files specified by command line. The program calculates and appends hashes to the updated hash file in the format spec- ified by formating options. Hashes are calculated for those files from the same directory as the hash file, which are yet not present in it. --check-embedded Verify files by crc32 sum embedded in their names. --torrent Create a torrent file for each processed file. -h, --help Help: print help screen and exit. -V, --version Version: print version and exit. -B, --benchmark Run benchmark for selected algorithm(s). HASH SUMS OPTIONS
-C, --crc32 CRC32: calculate and print CRC32 hash sum. --md4 MD4: calculate and print MD4 hash sum. -M, --md5 MD5: calculate and print MD5 hash sum. -H, --sha1 SHA1: calculate and print SHA1 hash sum. --sha224, --sha256, --sha384, --sha512 Calculate specified SHA2 hash sum. --tiger Tiger: calculate and print Tiger hash sum. -T, --tth TTH: calculate and print DC++ TTH sum. --btih BTIH: calculate and print BitTorrent Info Hash. -A, --aich AICH: calculate and print AICH hash. -E, --ed2k ED2K: calculate and print eDonkey 2000 hash sum. -L, --ed2k-link eDonkey link: calculate and print eDonkey link. -W, --whirlpool Whirlpool: calculate and print Whirlpool hash sum. -G, --gost GOST: calculate and print GOST R 34.11-94 hash, the Russian GOST standard hash function. --gost-cryptopro GOST-CRYPTOPRO: calculate and print CryptoPro version of the GOST R 34.11-94 hash function. --ripemd160 RIPEMD-160: calculate and print RIPEMD-160 hash sum. --has160 HAS-160: calculate and print HAS-160 hash sum. --snefru128, --snefru256 SNEFRU: calculate and print SNEFRU-128/256 hash sums. --edonr256, --edonr512 EDON-R: calculate and print EDON-R 256/512 hash sums. -a, --all Calculate all supported hash sums. --list-hashes List names of all supported hashes, one per line. MISCELLANEOUS OPTIONS
-r, --recursive Process directories recursively. -v, --verbose Be verbose. --percents Show percents, while calculating or checking sums --skip-ok Don't print OK messages for successfully verified files. -i, --ignore-case Ignore case of filenames when updating crc files. --speed Print per-file and the total processing speed. -e, --embed-crc Rename files by inserting crc32 sum into name. --embed-crc-delimiter=<delimiter> Insert specified <delimiter> before a crc sum in the --embed-crc mode, default is white space. The <delimiter> can be a character or empty string. --path-separator=<separator> Use specified path separator to display paths. -q, --accept=<list> Set a comma-delimited list of extensions of the files to calculate sums for. -t, --crc-accept=<list> Comma-delimited list of crc files extensions. --maxdepth=<levels> Descend at most <levels> (a non-negative integer) levels of directories below the command line arguments. `--maxdepth 0' means only apply the tests and actions to the command line arguments. -o, --output=<file-path> Set the file to output calculated hashes and verification results to. -l, --log=<file-path> Set the file to log errors and verbose information to. --openssl=<list> Specify which hash functions should be calculated using the OpenSSL library. The <list> is a comma delimited list of hash names, but only those supported by openssl are allowed, e.g. md4, md5, sha1, sha256, ripemd160. See openssl documentation for the full list. --gost-reverse Reverse bytes in hexadecimal output of the GOST hash sum. The most significant bytes of the hash will be printed first. Default order is the least significant bytes first. --bt-batch=<file-path> Turn on torrent batch mode (implies torrent mode). Calculates batch-torrent for the files specified at command line and saves the torrent file to the file-path. The option -r <directory> can be useful in this mode. --bt-private Generate BTIH for a private BitTorrent tracker. --bt-piece-length Set the piece length value for torrent file. --bt-announce Set tracker announcement url for torrent file. Note that this url doesn't change BTIH hash. --benchmark-raw Switch benchmark output format to be a machine-readable tab-delimited text with hash function name, speed, cpu clocks per byte. This option works only if the --benchmark option was specified. -- (double dash) Mark the end of command line options. All parameters following the double dash are interpreted as files or directories. It is typi- cally used to process filenames starting with a dash `-'. Alternatively you can specify './' or full path before such files, so they will not look like options anymore. OUTPUT FORMAT OPTIONS
--sfv Print hash sums in the SFV (Simple File Verification) output format (default). But unlike common SFV file, not only CRC32, but any hash sums specified by options can be printed. -m, --magnet Print hash sums formated as magnet links. --bsd Use BSD output format. Each hash sum is printed on separate line after hash name and file's path, enclosed in parentheses. --simple Use simple output format. Each line will consist of filename and hash sums specified by options. --uppercase Print hash sums in upper case. --lowercase Print hash sums in lower case. --template=<file> Read printf-like template from given <file>. See the --printf option. -p, --printf=<format> Format: print format string the standard output, interpreting `' escapes and `%' directives. The escapes and directives are: Newline. Carriage return. Horizontal tab. \ A literal backslash (`'). ASCII NUL. NNN The character which octal ASCII code is NNN. xNN The character which hexadecimal ASCII code is NN. A `' character followed by any other character is treated as an ordinary character, so they both are printed. %% A literal percent sign. %p File's path. %f File's name. %u URL-encoded filename. %s File's size in bytes. %{mtime} File's last modification time. %a or %A AICH hash sum. %c or %C CRC32 hash sum. Use %c for lowercase and %C for uppercase characters. %g or %G GOST R 34.11-94 hash. %h or %H SHA1 hash. %e or %E ED2K hash sum. %l or %L EDonkey ed2k://... link. %m or %M MD5 hash. %r or %R RIPEMD-160 hash. %t or %T TTH sum. %w or %W Whirlpool hash. %{md4}, %{sha224}, %{sha256}, %{sha384}, %{sha512}, %{tiger}, %{btih}, %{gost-cryptopro}, %{has160}, %{snefru128}, %{snefru256}, %{edon-r256}, %{edon-r512} Print specified hash sum. Actually the %{<hash sum>} directive can print any supported hash sum. If a hash sum name starts with a capital letter then the hash is printed in uppercase, e.g. %{TTH}, %{Sha512}. %x<hash>, %b<hash>, %B<hash>, %@<hash> Use one of these prefixes to output a hash sum in hexadecimal, base32, base64 or raw (binary) format respectively, e.g. %b{md4}, %BH or %xT. CONFIG FILE
RHash looks for a config file at $HOME/.rhashrc and /etc/rhashrc. The config file consists of lines formated as variable = value where the variable can be a text part of any command line option, like magnet, printf, percents, etc. Simple boolean values can be set using `1', `on' or `yes'. Empty lines and lines starting with `#' or `;' are ignored. Example config file: # This is a comment line percents = on crc-accept = .sfv,.md5,.sha1,.sha256,.sha512,.tth,.magnet AUTHOR
Aleksey Kravchenko <rhash.admin@gmail.com> SEE ALSO
md5sum(1) cksfv(1) ed2k_hash(1) BUGS
Bug reports are welcome! Send them by email or post to the SourceForge Bug Tracking System http://sourceforge.net/projects/rhash/ Linux APR 2010 RHASH(1)
All times are GMT -4. The time now is 01:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy