percent-encoder alternatives and similar packages
Based on the "network" category.
Alternatively, view percent-encoder alternatives based on common mentions on social networks and blogs.
-
compendium-client
Mu (μ) is a purely functional framework for building micro services. -
nakadi-client
Haskell Client Library for the Nakadi Event Broker -
dmcc
Haskell bindings for AVAYA DMCC API and WebSockets server for AVAYA -
resolv
Domain Name Service (DNS) lookup via the libresolv standard library routines -
network-address
IP data structures and textual representation -
network-data
Network data structures in Haskell (IP, UDP, TCP headers, etc) -
network-uri-json
FromJSON and ToJSON Instances for Network.URI -
windns
Domain Name Service (DNS) lookup via the Windows dnsapi standard library -
hatexmpp3
XMPP client with synthetic filesystem (9P) and (optional) graphical (GTK3) interfaces -
hsendxmpp
sendxmpp clone and drop-in replacement, sending XMPP messages via CLI -
LDAPv3
Lightweight Directory Access Protocol V3 (LDAPv3) RFC4511 implementation -
transient-universe-tls
Secure communications for transient-universe -
network-voicetext
VoiceText Web API Haskell wrapper library -
iwlib
A binding to the iw library for getting info about the current WiFi connection. -
network-uri-lenses
lenses for http://hackage.haskell.org/package/network-uri -
oauth2-jwt-bearer
OAuth2 jwt-bearer client flow as per rfc7523. -
network-simple-wss
Simple Haskell interface to TLS secured WebSockets -
attoparsec-uri
A compositional URI parser / printer for attoparsec
Static code analysis for 29 languages.
Do you think we are missing an alternative of percent-encoder or a related project?
README
Percent.Encoder
A simple, fast percent encoder/decoder for bytestrings. Encodes all bytes except for those matching the unreserved set in RFC 3986.
Example
ghci> :set -XOverloadedStrings
ghci> import Percent.Encoder
ghci> encode "I have to tell you about this simple lib!"
"I%20have%20to%20tell%20you%20about%20this%20simple%20lib%21"
ghci> decode "TELL-ME-MORE%20%3A%29"
"TELL-ME-MORE :)"
Benchmark
My naive benchmark shows percent-encoder, compared to Network.URI to be about 2x faster than at encoding and the same speed at decoding a fixed string:
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2
$ cabal bench criterion
...
benchmarking Percent.Encoder/encode
time 890.7 ns (887.3 ns .. 893.7 ns)
1.000 R² (1.000 R² .. 1.000 R²)
mean 887.6 ns (885.1 ns .. 889.9 ns)
std dev 8.241 ns (7.090 ns .. 10.00 ns)
benchmarking Percent.Encoder/decode
time 553.6 ns (551.9 ns .. 554.8 ns)
1.000 R² (1.000 R² .. 1.000 R²)
mean 551.1 ns (549.8 ns .. 552.2 ns)
std dev 4.142 ns (3.401 ns .. 5.173 ns)
benchmarking Network.URI/escapeURIString
time 1.598 μs (1.593 μs .. 1.603 μs)
1.000 R² (1.000 R² .. 1.000 R²)
mean 1.584 μs (1.581 μs .. 1.589 μs)
std dev 13.65 ns (11.55 ns .. 15.90 ns)
benchmarking Network.URI/unEscapeString
time 530.7 ns (530.2 ns .. 531.2 ns)
1.000 R² (1.000 R² .. 1.000 R²)
mean 530.6 ns (529.9 ns .. 531.2 ns)
std dev 2.053 ns (1.717 ns .. 2.464 ns)
Gotchas
- Does not check for invalid UTF-8 byte sequences
- Does not protect against decoding invalid strings, like
"%"
Author
© 2020 David Farrell, see LICENSE
*Note that all licence references and agreements mentioned in the percent-encoder README section above
are relevant to that project's source code only.