lz_string 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +66 -1
  3. data/lib/lz_string/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 536eca3d25c94ce1558bd881c8f09dfa5dab331a7d3c3da19a5166681ad2ac41
4
- data.tar.gz: 86d3a24237c3e1654b9b3c29bf7978435e68cf4caa6a22a66b04472ac222b3df
3
+ metadata.gz: 4deb314dc56a99124ebd3b6f2cbf7c2606c53e72bbcc01ffd1dd1b300138c063
4
+ data.tar.gz: c563a44e9b4f999f8a129f0acd066fed1a05c1f9ecc2b171b5245fe5b3d652ac
5
5
  SHA512:
6
- metadata.gz: 311b8e802592b7c364c43f031c89b6fa104b76637c2679d6a0d7f8955ffd40e63e55d48543e9f371f64a38e23e6bdce9d1a7b3985057b10a8717ca699b89cdcb
7
- data.tar.gz: d1e2f28b4c9ed85483254ed7d7f8f90cdb438f112b115e0f893be9a91986714990805acd1ba0a2126bf92e79a60b19660ac98c5e953903cd3c678d6511e822a6
6
+ metadata.gz: b7f31cf34b11b9850ec6f49a11f067e9edf8073d1560953334a615a4bee7486ed2ba653c8129baae694f073e0343e22fbfcd86495f75c8848fce72bdd390238a
7
+ data.tar.gz: fc6e306345c9e16c46e8e07269aeeb7170c73b35d9ef484cb32a99ccc5b69e7ffc9599fdc76366a4646a51478664aef77d6a30314e24d685bd6c71fd93d2a1c2
data/README.md CHANGED
@@ -1,2 +1,67 @@
1
1
  # lz-string
2
- Ruby implementation of LZ-String compression algorithm
2
+ Ruby implementation of [LZ-String](https://github.com/pieroxy/lz-string) compression algorithm.
3
+
4
+ Supports:
5
+ * Raw compression
6
+ * UTF-16 compression
7
+ * Base64 compression
8
+
9
+ ### Installation
10
+
11
+ Install the latest release:
12
+
13
+ ```
14
+ $ gem install lz_string
15
+ ```
16
+
17
+ In Rails, add it to your Gemfile:
18
+
19
+ ```ruby
20
+ gem 'lz_string'
21
+ ```
22
+
23
+ ### How to use
24
+
25
+ #### Normal Compression and Decompression:
26
+
27
+ ``` ruby
28
+ # Compress
29
+ compressed = LZString.compress("Hello world!")
30
+ => "҅〶惶@✰Ӏ葀"
31
+
32
+ # Decompress
33
+ LZString.decompress(compressed)
34
+ => "Hello world!"
35
+ ```
36
+
37
+ #### UTF-16 Compression and Decompression:
38
+
39
+ ``` ruby
40
+ some_string = '{"some": "json", "foo": [{"bar": "؋", "key": "؄"}], "ঞᕠ": "൱ඵቜ"}'
41
+
42
+ # Compress
43
+ compressed = LZString::UTF16.compress(some_string)
44
+ => "ᯡࡓ䈌\u0B80匰ᜠр\u0AF2Ǹ䀺㈦イ\u0530්C¦¼䒨ᨬිnj〩痐࠸С㸢璑Ч䲤U⋴ҕ䈥㛢ĉ႙ "
45
+
46
+ # Decompress
47
+ LZString::UTF16.decompress(compressed)
48
+ => "{\"some\": \"json\", \"foo\": [{\"bar\": \"؋\", \"key\": \"؄\"}], \"ঞᕠ\": \"൱ඵቜ\"}"
49
+ ```
50
+
51
+ #### Base64 Compression and Decompression:
52
+
53
+ ``` ruby
54
+ # Compress
55
+ compressed = LZString::Base64.compress("Hello world!")
56
+ => "BIUwNmD2AEDukCcwBMCEQ==="
57
+
58
+ # Decompress
59
+ LZString::Base64.decompress(compressed)
60
+ => "Hello world!"
61
+ ```
62
+
63
+ ### Tests
64
+
65
+ ``` bash
66
+ $ rake
67
+ ```
@@ -1,4 +1,4 @@
1
1
  module LZString
2
2
  # :nodoc:
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lz_string
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Altivi