Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@ekrano:~# cat test.js
- const zlib = require('zlib');
- const inputString = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
- const buffer = Buffer.from(inputString, 'utf-8');
- // Compress the buffer using Brotli
- zlib.brotliCompress(buffer, (err, compressedBuffer) => {
- if (err) {
- console.error('Error compressing data:', err);
- return;
- }
- // Convert compressed buffer to string
- const compressedString = compressedBuffer.toString('base64');
- console.log('Compressed string:', compressedString);
- // Decompress the compressed buffer to verify
- zlib.brotliDecompress(compressedBuffer, (err, decompressedBuffer) => {
- if (err) {
- console.error('Error decompressing data:', err);
- return;
- }
- // Convert decompressed buffer back to string
- const decompressedString = decompressedBuffer.toString('utf-8');
- console.log('Decompressed string:', decompressedString);
- });
- });
- root@ekrano:~# node test.js
- [ 111.646322] Alignment trap: node (8007) PC=0xb6e59c10 Instr=0xf4640add Address=0xaf21683c FSR 0x001
- [ 111.655634] Alignment trap: not handling instruction f4640add at [<b6e59c10>]
- [ 111.663007] 8<--- cut here ---
- [ 111.666112] Unhandled fault: alignment exception (0x001) at 0xaf21683c
- [ 111.672757] [af21683c] *pgd=45271835, *pte=55d4b75f, *ppte=55d4bc7f
- [ 111.680808] node: node: potentially unexpected fatal signal 7.
- [ 111.686778] CPU: 2 UID: 0 PID: 8007 Comm: node Tainted: G O 6.12.23-venus-2 #1
- [ 111.695654] Tainted: [O]=OOT_MODULE
- [ 111.699189] Hardware name: Allwinner sun8i Family
- [ 111.704055] PC is at 0xb6e59c14
- [ 111.707242] LR is at 0xb6e59bfc
- [ 111.710492] pc : [<b6e59c14>] lr : [<b6e59bfc>] psr: 40040010
- [ 111.716800] sp : b0bfd100 ip : af216c3c fp : 00000002
- [ 111.722129] r10: 00000001 r9 : b0bfd16c r8 : af2309e4
- [ 111.727432] r7 : af2249c4 r6 : 00000000 r5 : 00000009 r4 : af21683c
- [ 111.734218] r3 : 00000002 r2 : af2309e4 r1 : af2147bc r0 : af2309e4
- [ 111.740892] Flags: nZcv IRQs on FIQs on Mode USER_32 ISA ARM Segment user
- [ 111.748206] Control: 10c5387d Table: 44da406a DAC: 00000055
- Bus error
Add Comment
Please, Sign In to add comment