[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#894222: libghc-sha-dev: a gibberish in bytestringDigest

Dear Рома,

this is not a bug. SHA.bytestringDigest returns the digest in binary
format. If you hex-encode it, you get the usual textual representation:

Prelude> import qualified Data.ByteString.Lazy.Char8 as LBS
Prelude LBS>  import qualified Data.Digest.Pure.SHA as SHA
Prelude LBS SHA> let signature = SHA.hmacSha256 (LBS.pack "1") (LBS.pack "")
Prelude LBS SHA> signature
Prelude LBS SHA> SHA.showDigest signature
Prelude LBS SHA> let bs = SHA.bytestringDigest signature
Prelude LBS SHA> Data.ByteString.Base16.Lazy.encode bs


Am Dienstag, den 27.03.2018, 20:55 +0700 schrieb Рома Тенцер:
> Package: libghc-sha-dev
> Version:
> Severity: normal
> When I use bytestringDigest i have a gibberish instead of proper 
> signature. I test it with hmacSha256, sha256 and sha512 with the same 
> result. showDigest works fine. An example is attached.
> -- System Information:
> Debian Release: 9.4
>    APT prefers stable-updates
>    APT policy: (500, 'stable-updates'), (500, 'stable')
> Architecture: i386 (i686)
> Kernel: Linux 4.9.0-6-686-pae (SMP w/1 CPU core)
> Locale: LANG=ru_RU.utf8, LC_CTYPE=ru_RU.utf8 (charmap=UTF-8), 
> LANGUAGE=ru_RU.utf8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> Versions of packages libghc-sha-dev depends on:
> ii  ghc [libghc-bytestring-dev-]  8.0.1-17+b1
> ii  libc6                                       2.24-11+deb9u3
> pn  libghc-array-dev-              <none>
> pn  libghc-base-dev-               <none>
> pn  libghc-binary-dev-             <none>
> ii  libgmp10                                    2:6.1.2+dfsg-1
> libghc-sha-dev recommends no packages.
> Versions of packages libghc-sha-dev suggests:
> ii  libghc-sha-doc
> pn  libghc-sha-prof  <none>
> -- no debconf information
> _______________________________________________
> Pkg-haskell-maintainers mailing list
> Pkg-haskell-maintainers@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-haskell-maintainers
Joachim “nomeata” Breitner
Debian Developer
  nomeata@debian.org • https://people.debian.org/~nomeata
  XMPP: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: