Let, I have a string with 20 characters. Then, I need to compress it to a string with a length of 3 or 5 characters. Again, when I need the original string back, I should be able to decompress the compressed string and get the original string.
Is it possible to do? If yes, how to do it in REACT NATIVE? Can you please suggest me a good solution?
Thanks.
Try like this, may help you:
var lz = require('lz-string');
let before = lz.compress("bla bla bla")
let after = lz.decompress(before)
console.log(before, before.length);// ᆁ낆J鵀 4
console.log(after, after.length); // bla bla bla 11
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With