zlib-rs, enye indlela ye-zlib-rs kwi-Rust ejonge ukujongana neengxaki ezibangelwa ziimpazamo zememori.

zlib-rs enye indawo kwilayibrari yoxinzelelo lwedatha ye-zlib

zlib-rs

Ithala leencwadi lezlib, iphuhliswe nguJean-Loup Gailly kunye noMark Adler, yinxalenye ebalulekileyo kuba isetyenziswa kuluhlu olubanzi lwezicelo ezi igxile kuxinzelelo lweefayile kwiifomathi ezinjengeZIP, gzip kunye nePNG ngenxa yokusebenza kakuhle kunye nokuguquguquka kwayo. Eli thala leencwadi ikhona ukusukela ngo-1995 kwaye ngenxa yosetyenziso lwayo olubanzi, ikwayithagethi yobuthathaka bokhuseleko lwenkumbulo.

Undoqo we-zlib yi-DEFLATE compression algorithm, edibanisa ubuchule bokucinezela idatha engalahlekiyo ye-algorithm ye-LZ77 kunye nesakhiwo somthi we-Huffman ukuphumeza amazinga oxinzelelo oluphawulekayo. Olu luhlu lweendlela zokwenza i-zlib isebenze ngokugqithisileyo ekucinezeleni nasekunciphiseni idatha, iyenza ibe luncedo ngakumbi kwizicelo apho indawo yokugcina okanye i-bandwidth ilinganiselwe.

Ukongeza koxinzelelo lwefayile, zlib Ikwasetyenziselwa ukuhambisa idatha ecinezelweyo kwiinethiwekhi ukunciphisa umthwalo we-bandwidth, kwindawo yokugcina iifayile kunye nokucubungula izicelo, kunye nakwimultimedia izicelo zokucinezela idatha yeaudio kunye nevidiyo.

Ixesha elidlulele, zlib iye yajongana nobuthathaka obuthe basonjululwa kwiinguqulelo zamva nje ze-zlib, ezifana ne-CVE-2005-1849 ekhankanywe ngasentla, i-CVE-2016-9840, i-CVE-2016-9841 kunye ne-CVE-2016-9842 (ukukhankanya nje ezinye ezaziwayo ezivela kwi-zlib), ezinokuthi zisetyenziswe. ngabahlaseli ukubangela ukukhanyelwa kwenkonzo (DoS) okanye nokwenza ikhowudi engafanelekanga kwaye ngenxa yeziphoso zokhuseleko lwememori eziqhelekileyo kwiilayibrari zoxinzelelo ezibhalwe kwi-C / C ++, i-zlib ihlala iyinjongo enkulu.

Ukuze kulungiswe ezi ngxaki, ngaphandle kokushiya ecaleni indalo kunye neenzuzo ze-zlib, ISRG (umbutho ongemva kweprojekthi ye-Masibethele kwaye uzinikele ekuphuculeni ukhuseleko lwe-intanethi) kutshanje ubhengeze ukusungulwa kweprojekthi entsha Injongo kukwenza i-analogue ye-zlib ngolwimi lweprogram ye-Rust.

Siqeshe i-Tweede Golf ngoDisemba ka-2023 ukuphunyezwa kokuqala okusekwe kwi-zlib-ng, sigxile ekugcineni ukusebenza okugqwesileyo ngelixa sazisa ukhuseleko lwememori.

Yintoni elandelayo

Ngoku sifuna inkxaso-mali ukuze sigqibezele umsebenzi oyimfuneko ukuze uphunyezo lokuqala lulungele ukuveliswa.

Enye indlela entsha ibizwa ngokuba "Zlib-rs" kwaye oku kunikezelwa njenge isisombululo se-zlib esibhalwe kwiRust ngeyona njongo iphambili yokujongana nemiba yokhuseleko ehambelana neempazamo zememori kunye nobuthathaka obuhlala bukhona kwiilayibrari zoxinzelelo ezibhalwe kwiC/C++.

Uphuhliso lwe-zlib-rs ivela kwimpendulo kwizibalo ezivela kuMicrosoft kunye noGoogle ezibonisa ukuba malunga I-70% yobuthathaka ngenxa yolawulo lwememori olungakhuselekanga. Ngokusebenzisa iRust njengolwimi lwenkqubo, kulindeleke ukuba inciphise kakhulu umngcipheko wobu bubuthathaka, obufana nokufikelela kwiindawo ezikhuselweyo zememori okanye ukuphuphuma kwebuffer.

Le projekthi I-zlib-rs iqulethe ukuphunyezwa kwe-Rust yefomati yefayile ye-zlib ehambelana ne-zlib API. kwaye indawo yokugcina ngoku isebenza kwiinkqubo ezimbini:

  • zlib-rs, ukuphunyezwa kwe-Rust esekwe kwi-zlib kunye ne-API ye-Rust ekhuselekileyo (okwangoku ithathwa njengengazinzanga, kodwa ilindeleke ukuzinzisa ukuphunyezwa kungekudala).
  • libz-rs-sys, a C API a C API for zlib-rs . I-API ilingana ngokubanzi ne-zlib-sys kunye ne-zlib-ng-sys, kodwa okwangoku ayiboneleli nge-gz* usapho lwemisebenzi. Ukusuka kwimbono yomhlwa, le API ayikho i-ergonomic kakhulu, ngoko ke ukusebenza kunye ne-flate2 kuyacetyiswa ngoku.

Ngokumalunga nomsebenzi kuphuhliso lwangoku, kukhankanyiwe ukuba ukunika i-analogue kwi-Rust kunokutsala umdla wabanye kwaye banokujoyina umsebenzi, kuba ukubonelela ngenye indlela egxile kukhuseleko kunye nokuthintela iimpazamo eziqhelekileyo, kunokwenzeka kwiminyaka ethile. yomsebenzi kunye nophuhliso zibonelela ngokutshintshwa okuselubala kwe-zlib.

Ekugqibeleni, kuyafaneleka ukukhankanya ukuba umsebenzi we-zlib-rs ngoku upapashwe kwi-GitHub kwindawo yokugcina yokugcina kwaye ikhowudi isasazwa phantsi kwelayisensi ye-Zlib. Ungajonga ngakumbi ngayo en eli khonkco lilandelayo.


Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa. ezidingekayo ziphawulwe *

*

*

  1. Inoxanduva lwedatha: I-AB Internet Networks 2008 SL
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.