Re: sha512sum (program) gives different result than sha512 in PG11 - Mailing list pgsql-general

From Thomas Markus
Subject Re: sha512sum (program) gives different result than sha512 in PG11
Date
Msg-id b2d3e8a1-bd53-f834-d751-1fdd2bcd45af@proventis.net
Whole thread Raw
In response to sha512sum (program) gives different result than sha512 in PG11  (Andreas Joseph Krogh <andreas@visena.com>)
Responses Sv: Re: sha512sum (program) gives different result than sha512 in PG11  (Andreas Joseph Krogh <andreas@visena.com>)
List pgsql-general
Hi,

echo contains a trailing carriage return. Try

echo -n "A" | sha512sum

regards
Thomas


Am 14.01.19 um 16:16 schrieb Andreas Joseph Krogh:
Hi.
 
Anyone can explain why these two don't give the same result?
 
1.
$ echo "A" | sha512sum
7a296fab5364b34ce3e0476d55bf291bd41aa085e5ecf2a96883e593aa1836fed22f7242af48d54af18f55c8d1def13ec9314c926666a0ba63f7663500090565  -

 
2.
$ psql -A -t -c "select encode(sha512('A'), 'hex')"
21b4f4bd9e64ed355c3eb676a28ebedaf6d8f17bdc365995b319097153044080516bd083bfcce66121a3072646994c8430cc382b8dc543e84880183bf856cff5

 
Thanks!
 
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963


Attachment

pgsql-general by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: sha512sum (program) gives different result than sha512 in PG11
Next
From: Andreas Joseph Krogh
Date:
Subject: Sv: Re: sha512sum (program) gives different result than sha512 in PG11