Guest User

Untitled

a guest
May 15th, 2025
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. root@ekrano:~# cat test.js
  2.  
  3. const zlib = require('zlib');
  4. const inputString = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
  5. const buffer = Buffer.from(inputString, 'utf-8');
  6.  
  7. // Compress the buffer using Brotli
  8. zlib.brotliCompress(buffer, (err, compressedBuffer) => {
  9. if (err) {
  10. console.error('Error compressing data:', err);
  11. return;
  12. }
  13.  
  14. // Convert compressed buffer to string
  15. const compressedString = compressedBuffer.toString('base64');
  16. console.log('Compressed string:', compressedString);
  17. // Decompress the compressed buffer to verify
  18. zlib.brotliDecompress(compressedBuffer, (err, decompressedBuffer) => {
  19. if (err) {
  20. console.error('Error decompressing data:', err);
  21. return;
  22. }
  23. // Convert decompressed buffer back to string
  24. const decompressedString = decompressedBuffer.toString('utf-8');
  25. console.log('Decompressed string:', decompressedString);
  26. });
  27. });
  28.  
  29.  
  30.  
  31. root@ekrano:~# node test.js
  32. [ 111.646322] Alignment trap: node (8007) PC=0xb6e59c10 Instr=0xf4640add Address=0xaf21683c FSR 0x001
  33. [ 111.655634] Alignment trap: not handling instruction f4640add at [<b6e59c10>]
  34. [ 111.663007] 8<--- cut here ---
  35. [ 111.666112] Unhandled fault: alignment exception (0x001) at 0xaf21683c
  36. [ 111.672757] [af21683c] *pgd=45271835, *pte=55d4b75f, *ppte=55d4bc7f
  37. [ 111.680808] node: node: potentially unexpected fatal signal 7.
  38. [ 111.686778] CPU: 2 UID: 0 PID: 8007 Comm: node Tainted: G O 6.12.23-venus-2 #1
  39. [ 111.695654] Tainted: [O]=OOT_MODULE
  40. [ 111.699189] Hardware name: Allwinner sun8i Family
  41. [ 111.704055] PC is at 0xb6e59c14
  42. [ 111.707242] LR is at 0xb6e59bfc
  43. [ 111.710492] pc : [<b6e59c14>] lr : [<b6e59bfc>] psr: 40040010
  44. [ 111.716800] sp : b0bfd100 ip : af216c3c fp : 00000002
  45. [ 111.722129] r10: 00000001 r9 : b0bfd16c r8 : af2309e4
  46. [ 111.727432] r7 : af2249c4 r6 : 00000000 r5 : 00000009 r4 : af21683c
  47. [ 111.734218] r3 : 00000002 r2 : af2309e4 r1 : af2147bc r0 : af2309e4
  48. [ 111.740892] Flags: nZcv IRQs on FIQs on Mode USER_32 ISA ARM Segment user
  49. [ 111.748206] Control: 10c5387d Table: 44da406a DAC: 00000055
  50. Bus error
  51.  
Add Comment
Please, Sign In to add comment