haskell / base16-bytestring Goto Github PK
View Code? Open in Web Editor NEWFast base16 (hexadecimal) encoding and decoding for Haskell bytestrings.
License: Other
Fast base16 (hexadecimal) encoding and decoding for Haskell bytestrings.
License: Other
8.10.2 8.8.4 8.6.5 8.4.4 8.2.2 8.0.2 7.10.3 7.8.4 7.6.3 7.4.2 7.2.2 7.0.4
base16-bytestring-1.0.0.0 NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP
base16-bytestring-0.1.1.7 OK OK OK OK OK OK FAIL FAIL FAIL FAIL FAIL FAIL
base16-bytestring-0.1.1.6 OK OK OK OK OK OK FAIL FAIL FAIL FAIL FAIL FAIL
base16-bytestring-0.1.1.5 OK OK OK OK OK OK FAIL FAIL FAIL FAIL FAIL FAIL
base16-bytestring-0.1.1.4 NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP
base16-bytestring-0.1.1.3 NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP
base16-bytestring-0.1.1.2 NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP
base16-bytestring-0.1.1.1 NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP
base16-bytestring-0.1.1.0 NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP
base16-bytestring-0.1.0.0 NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP NO-IP
Please make revisions to 0.1.1.7
, 0.1.1.6
and 0.1.1.5
. Thank you in advance.
rejecting: base16-bytestring-1.0.2.0 (conflict: bytestring==0.12.0.2, base16-bytestring => bytestring>=0.9 && <0.12)
Steps to reproduce:
Prelude> import qualified Data.ByteString.Base16.Lazy as BL16
Prelude BL16> import qualified Data.ByteString.Lazy as BSL
Prelude BL16 BSL> :set -XOverloadedStrings
Prelude BL16 BSL> BL16.encode "aB9"
"614239"
Prelude BL16 BSL> let encoded1 = BL16.encode "aB9"
Prelude BL16 BSL> let encoded2 = BSL.fromChunks ["614","239"]
Prelude BL16 BSL> BL16.decode encoded2
("aI#","")
Prelude BL16 BSL> BL16.decode encoded1
("aB9","")
Lazy decoding is lazy when successful:
λ> (B.unpack . B.take 8 . fst . B.decode) (B.iterate id 48)
[0,0,0,0,0,0,0,0]
But it is not lazy when there is a decoding failure:
λ> (B.unpack . B.take 8 . fst . B.decode) (B.iterate id 47)
I would expect this second example to produce []
, but it never terminates.
I believe the release broke at least:
and as a consequence all deps that depend on text-conversions:
and all deps that depend on string-interpolate:
Yes, I believe checking reverse dependencies is what we should do before a release: https://packdeps.haskellers.com/reverse/base16-bytestring
This will just be a revision update, so a hackage trustee could unbreak this. @phadej ?
This function is convenient. Here is the sample implementation of this function:
newtype Decode16Error = Decode16Error ByteString
-- | Decode base16-encoded ByteString.
decodeEither :: ByteString -> Either Decode16Error ByteString
decodeEither = handleError . decode
where
handleError (res,rest)
| BS.null rest = Right res
| otherwise = Left $ Decode16Error $ "suffix is not in base-16 format: " <> rest
*Prelude Base16> Base16.encode . fst . Base16.decode $ BSC.pack "AA"
"bb"
*Prelude Base16> Base16.decode $ BSC.pack "FF"
("","FF")
There seems to be an off-by-one error in the decoding table.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.