<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to get a CRC or a quick hash of a single line of text? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119137#M92893</link>
    <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;/* NO POINTS PLEASE */&lt;BR /&gt;&lt;BR /&gt;Sorry for the double post.  I got an error posting and decided my reply had hit the black hole.  Hence, I added a closing thought and submitted again.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Wed, 19 Dec 2007 18:44:48 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2007-12-19T18:44:48Z</dc:date>
    <item>
      <title>how to get a CRC or a quick hash of a single line of text?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119134#M92890</link>
      <description>I want to get a hash of a whole line of text. A CRC would probably do even better for this application that I'm working on.&lt;BR /&gt;&lt;BR /&gt;I've never tried to get one before - short of writing one in C oh so many moons ago, but I figure that there's gotta be some out there already. Anyone can give me some advice on this?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Wed, 19 Dec 2007 17:55:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119134#M92890</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-12-19T17:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a CRC or a quick hash of a single line of text?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119135#M92891</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# echo "this is a line of text"|cksum&lt;BR /&gt;2829970435&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# echo "this is a line of text"|md5sum&lt;BR /&gt;edb95cc51670abff69d0af7fa1c8122b&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Dec 2007 18:10:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119135#M92891</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-12-19T18:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a CRC or a quick hash of a single line of text?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119136#M92892</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# echo "this is a line of text"|cksum&lt;BR /&gt;2829970435&lt;BR /&gt;&lt;BR /&gt;# echo "this is a line of text"|md5sum&lt;BR /&gt;edb95cc51670abff69d0af7fa1c8122b&lt;BR /&gt;&lt;BR /&gt;# echo "this is a line of text"|sum -r|cut -f1 -d" "&lt;BR /&gt;23527&lt;BR /&gt;&lt;BR /&gt;See the manpages for 'sum(1)' in particular too.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Dec 2007 18:13:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119136#M92892</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-12-19T18:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a CRC or a quick hash of a single line of text?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119137#M92893</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;/* NO POINTS PLEASE */&lt;BR /&gt;&lt;BR /&gt;Sorry for the double post.  I got an error posting and decided my reply had hit the black hole.  Hence, I added a closing thought and submitted again.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 19 Dec 2007 18:44:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119137#M92893</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-12-19T18:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a CRC or a quick hash of a single line of text?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119138#M92894</link>
      <description>Yet another way of generating a hash value for every single line of a file:&lt;BR /&gt;&lt;BR /&gt;# awk '{printf("%-15d\n", rand(srand(NR))*(10^9))}' file&lt;BR /&gt;&lt;BR /&gt;~cheers</description>
      <pubDate>Wed, 19 Dec 2007 19:19:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119138#M92894</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-12-19T19:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a CRC or a quick hash of a single line of text?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119139#M92895</link>
      <description>Thanks JRF!&lt;BR /&gt;&lt;BR /&gt;That's exactly what I needed.&lt;BR /&gt;&lt;BR /&gt;Much appreciated,&lt;BR /&gt;John</description>
      <pubDate>Wed, 19 Dec 2007 20:14:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119139#M92895</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-12-19T20:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a CRC or a quick hash of a single line of text?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119140#M92896</link>
      <description>JRF, 10 points for not being the only one who has double posted by accident, and fessing up.  Most of the time (but not all), when I've double posted myself, it's been because it took soooo long to post, I thought it was stuck, and in the meantime I thought of something to add, so I added it and posted, unfortunately, twice.  &lt;BR /&gt;&lt;BR /&gt;So, you get 10 points for being there like I've been there, because I thought I was the only one who had posts that look like that.  Yeah, I know you asked for no points, but since it is my thread and I get to decide, I decided to push 10 points on empathy.&lt;BR /&gt;:-) Nygeah :-)</description>
      <pubDate>Wed, 19 Dec 2007 20:21:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119140#M92896</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-12-19T20:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a CRC or a quick hash of a single line of text?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119141#M92897</link>
      <description>Sandman,&lt;BR /&gt;&lt;BR /&gt;Thanks for the nice awk script.  Can I ask you how to add a few more things to that?  I was going to shell script all of this, but since you've nailed down a piece of it in awk, I wonder if you'd mind helping me a bit more?&lt;BR /&gt;&lt;BR /&gt;Give me a) line number, b) CRC type sum code, and c) the text itself.  Separated by "^" symbol.&lt;BR /&gt;&lt;BR /&gt;I hate to ask, but if you're strong on awk, it would get me rolling pretty quickly on my little project.&lt;BR /&gt;&lt;BR /&gt;I think it would resemble:&lt;BR /&gt;&lt;BR /&gt;awk '{printf("%d^%-15d^$*\n",somelinecountervariable rand(srand(NR))*(10^9))}' /tmp/junk&lt;BR /&gt;&lt;BR /&gt;The problem that I'd have is identifying the linecounter variable.  I'm assuming there's a builtin in awk for this, instead of having to count with a loop???  Also, I'm supposing tha t$* prints the contents of the line, or would I use the (NR) maybe?&lt;BR /&gt;&lt;BR /&gt;Thanks if you can help!</description>
      <pubDate>Wed, 19 Dec 2007 20:33:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119141#M92897</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-12-19T20:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to get a CRC or a quick hash of a single line of text?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119142#M92898</link>
      <description>&amp;gt;Give me a) line number, b) CRC type sum code, and c) the text itself. &amp;gt;Separated by "^" symbol.&lt;BR /&gt;&lt;BR /&gt;NR stands for the line (aka record) number and $0 stands for the entire line.&lt;BR /&gt;&lt;BR /&gt;# awk '{printf("%d^%-13d^%s\n", NR, rand(srand(NR))*(10^9), $0)}' file&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Wed, 19 Dec 2007 22:52:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-get-a-crc-or-a-quick-hash-of-a-single-line-of-text/m-p/4119142#M92898</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-12-19T22:52:33Z</dc:date>
    </item>
  </channel>
</rss>

