From d405af197f1df84389afdcd1a340839dabe4b642 Mon Sep 17 00:00:00 2001 From: clyne Date: Mon, 28 Dec 2020 21:09:36 -0500 Subject: [PATCH] Update README.md --- README.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 242c403..374051b 100644 --- a/README.md +++ b/README.md @@ -8,25 +8,20 @@ Compression is achieved using [Huffman coding](https://en.wikipedia.org/wiki/Huf **1. Text configurations (e.g. JSON)** -A ~3.5kB string of JSON can be compressed down ~2.5kB ([see it on Godbolt](https://godbolt.org/z/1MzG1v)). +A ~3.5kB string of JSON can be compressed down ~2.5kB ([see it on Godbolt](https://godbolt.org/z/rqWf4v)). **2. Scripts (e.g. Lisp)** -A ~40 line comment-including sample of Lisp can be reduced from 1,662 bytes to 1,244 (418 bytes saved) ([Godbolt](https://godbolt.org/z/jcnKza)). +A ~40 line comment-including sample of Lisp can be reduced from 1,662 bytes to 1,244 (418 bytes saved) ([Godbolt](https://godbolt.org/z/Kbenbh)). ## How to Use ```cpp #include "consteval_huffman.hpp" -constexpr static const char some_data_raw[] = /* insert text here */; - -// Creates an object with the compressed data -// If data is not smaller after compression, huffman_compress will keep the data uncompressed -constinit static const auto some_data = huffman_compress(); - -// Or, with a set data length: -// ... some_data = huffman_compress(); +// Using the _huffman suffix creates an object with the compressed data. +// If data is not smaller after compression, the object will keep the data uncompressed. +constinit auto some_data = "This is my string of data"_huffman; int main() {