From bb3a9e181638fa881e2bcd8425f10cfb365533f5 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Tue, 16 Jul 2019 10:58:16 -0400 Subject: Add hex function to curse fingerprints with. --- Data/OpenPGP/Util.hs | 2 ++ Data/OpenPGP/Util/Fingerprint.hs | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Data/OpenPGP/Util.hs b/Data/OpenPGP/Util.hs index 1f9277d..1781d6d 100644 --- a/Data/OpenPGP/Util.hs +++ b/Data/OpenPGP/Util.hs @@ -1,5 +1,7 @@ module Data.OpenPGP.Util ( fingerprint + , Fingerprint(..) + , hex , decryptSecretKey , encryptSecretKey , verify diff --git a/Data/OpenPGP/Util/Fingerprint.hs b/Data/OpenPGP/Util/Fingerprint.hs index b2e3904..c1d8fef 100644 --- a/Data/OpenPGP/Util/Fingerprint.hs +++ b/Data/OpenPGP/Util/Fingerprint.hs @@ -1,5 +1,5 @@ {-# LANGUAGE CPP #-} -module Data.OpenPGP.Util.Fingerprint (fingerprint,Fingerprint(..)) where +module Data.OpenPGP.Util.Fingerprint (fingerprint,Fingerprint(..),hex) where import qualified Data.OpenPGP as OpenPGP import qualified Data.ByteString as BS @@ -23,7 +23,10 @@ oo = (.) . (.) newtype Fingerprint = Fingerprint BS.ByteString instance Show Fingerprint where - show (Fingerprint bs) = hexify bs + show fp = hex fp + +hex :: Fingerprint -> String +hex (Fingerprint bs) = hexify bs where hexify = map toUpper . hexString . BS.unpack -- cgit v1.2.3