crc16

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

crc16

Grzesiek Sójka
Hi there,

Is there any utility to calculate crc16 (not the crc32) in Debian?

Thanks in advance for any help

Reply | Threaded
Open this post in threaded view
|

Re: crc16

Curt
On 2019-09-11, Grzesiek Sójka <[hidden email]> wrote:
> Hi there,
>
> Is there any utility to calculate crc16 (not the crc32) in Debian?


curty@einstein:~$ apt-cache search crc16
node-crc - module for calculating Cyclic Redundancy Check (CRC)

> Thanks in advance for any help
>
>


--
Thug: This is a stickup! Now come on. Your money or your life.
[long pause]
Thug: [repeating] Look, bud, I said, 'Your money or your life.'
Jack Benny: I'm thinking, I'm thinking!

Reply | Threaded
Open this post in threaded view
|

Re: crc16

Curt
On 2019-09-11, Curt <[hidden email]> wrote:
> On 2019-09-11, Grzesiek Sójka <[hidden email]> wrote:
>> Hi there,
>>
>> Is there any utility to calculate crc16 (not the crc32) in Debian?
>
>
> curty@einstein:~$ apt-cache search crc16
> node-crc - module for calculating Cyclic Redundancy Check (CRC)

On second thought, maybe it's wiser to install 'python-crcmod'
(available from the repositories, I believe).

http://crcmod.sourceforge.net/crcmod.html


>> Thanks in advance for any help
>>
>>
>
>


--
Thug: This is a stickup! Now come on. Your money or your life.
[long pause]
Thug: [repeating] Look, bud, I said, 'Your money or your life.'
Jack Benny: I'm thinking, I'm thinking!

Reply | Threaded
Open this post in threaded view
|

Re: crc16

andy smith-10
In reply to this post by Grzesiek Sójka
Hello,

On Wed, Sep 11, 2019 at 11:37:11AM +0200, Grzesiek Sójka wrote:
> Is there any utility to calculate crc16 (not the crc32) in Debian?

It should be trivial in almost any scripting language available in
Debian. Here is a Perl example.

$ sudo apt install libdigest-crc-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  libdigest-crc-perl
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.2 kB of archives.
After this operation, 51.2 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 libdigest-crc-perl amd64 0.22.2-1+b1 [14.2 kB]
Fetched 14.2 kB in 0s (93.0 kB/s)
Selecting previously unselected package libdigest-crc-perl.
(Reading database ... 127754 files and directories currently installed.)
Preparing to unpack .../libdigest-crc-perl_0.22.2-1+b1_amd64.deb ...
Unpacking libdigest-crc-perl (0.22.2-1+b1) ...
Setting up libdigest-crc-perl (0.22.2-1+b1) ...
Processing triggers for man-db (2.8.5-2) ...

$ perl -MDigest::CRC -e '$ctx = Digest::CRC->new(type=>"crc16"); $ctx->addfile(*STDIN); print $ctx->b64digest' < /etc/os-release
lzA=

Cheers,
Andy

--
https://bitfolk.com/ -- No-nonsense VPS hosting

Reply | Threaded
Open this post in threaded view
|

Re: crc16

Jonas Smedegaard-2
In reply to this post by Grzesiek Sójka
Quoting Grzesiek Sójka (2019-09-11 11:37:11)
> Is there any utility to calculate crc16 (not the crc32) in Debian?

Yes.

For command-line use:

  jacksum
  radare2

  node-crc
  libdigest-crc-perl:
  python3-crcelk
  python3-crcmod
  tcllib

Latter part above are not really utilities, but can probably all of them
be used for oneliners - like this:

echo foobar|perl -MDigest::CRC=crc16 -nE'chomp;say "$_: ", crc16($_)'


 - Jonas

--
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

signature.asc (849 bytes) Download Attachment