Skip to content

Commit

Permalink
Replace broken fromBase16 with non-broken version
Browse files Browse the repository at this point in the history
  • Loading branch information
runarorama committed Dec 19, 2023
1 parent e690c5f commit a14d683
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/unison-util-bytes/src/Unison/Util/Bytes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,7 @@ arrayToChunk bs = case BA.convert bs :: Block Word8 of
chunkFromArray = arrayToChunk

fromBase16 :: Bytes -> Either Text.Text Bytes
fromBase16 bs = case traverse convert (chunks bs) of
Left e -> Left (Text.pack e)
Right bs -> Right (fromChunks bs)
where
convert b =
BE.convertFromBase BE.Base16 (chunkToArray @BA.Bytes b)
<&> arrayToChunk @BA.Bytes
fromBase16 = fromBase BE.Base16

toBase32, toBase64, toBase64UrlUnpadded :: Bytes -> Bytes
toBase32 = toBase BE.Base32
Expand Down

0 comments on commit a14d683

Please sign in to comment.