sha512sum (program) gives different result than sha512 in PG11

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: sha512sum (program) gives different result than sha512 in PG11
Date: 2019-01-14 15:16:24
Message-ID: VisenaEmail.34.21a93e71f9138ce2.1684cedbd5f@tc7-visena
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com>
<https://www.visena.com>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Markus 2019-01-14 15:18:30 Re: sha512sum (program) gives different result than sha512 in PG11
Previous Message Ravi Krishna 2019-01-14 14:14:17 Re: the installation of pgadmin4 makes me weep in frustration