pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Markus <t.markus@proventis.net>
To: Andreas Joseph Krogh <andreas@visena.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: sha512sum (program) gives different result than sha512 in PG11
Date: Mon, 14 Jan 2019 16:18:30 +0100
Message-ID: <b2d3e8a1-bd53-f834-d751-1fdd2bcd45af@proventis.net> (raw)
In-Reply-To: <VisenaEmail.34.21a93e71f9138ce2.1684cedbd5f@tc7-visena>
References: <VisenaEmail.34.21a93e71f9138ce2.1684cedbd5f@tc7-visena>

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
> andreas@visena.com <mailto:andreas@visena.com>
> www.visena.com <https://www.visena.com;
> <https://www.visena.com;

Attachments:

idhcmcljoddpddcn.png (image/png, 1.9K) download view image

view thread (2+ messages)

Message-ID: <b2d3e8a1-bd53-f834-d751-1fdd2bcd45af@proventis.net>
Permalink:  ../b2d3e8a1-bd53-f834-d751-1fdd2bcd45af@proventis.net/
Also on:    postgresql.org/message-id/b2d3e8a1-bd53-f834-d751-1fdd2bcd45af@proventis.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: t.markus@proventis.net, andreas@visena.com
  Subject: Re: sha512sum (program) gives different result than sha512 in PG11
  In-Reply-To: <b2d3e8a1-bd53-f834-d751-1fdd2bcd45af@proventis.net>
  References: <VisenaEmail.34.21a93e71f9138ce2.1684cedbd5f@tc7-visena> <b2d3e8a1-bd53-f834-d751-1fdd2bcd45af@proventis.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox