跳至內容

Brotli

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書
Brotli
Brotli
開發者Jyrki Alakuijala和Zoltán Szabadka
目前版本
  • 1.2.1(2026年10月21日;穩定版本)[1]
編輯維基數據連結
程式語言C[2][a]
許可協定 編輯維基數據連結
網站github.com/google/brotli 編輯維基數據

Brotli,是由Jyrki Alakuijala和Zoltán Szabadka(英語:Zoltán Szabadka)開發的開源數據壓縮程式庫。[4][5]Brotli,是基於LZ77演算法的現代變體、霍夫曼編碼和二階上下文建模(英語:Context_modeling)。

在Chrome、Opera和Firefox中,已用於加速萬維網的傳輸速度。[6] 類似Google的壓縮演算法zopfli,brotli這個名字來自瑞士的烘培產品brötli(英語:Spanisch_Brötli)。[7]

歷史

[編輯]

Brotli最初發布於2015年,用於網絡字體的離線壓縮。[8] 2015年9月,Google軟件工程師發布了包含通用無失真數據壓縮的Brotli增強版本,特別側重於HTTP壓縮。其中的編碼器被部分覆寫以提高壓縮比,編碼器和解碼器都提高了速度,改進串流API,增加更多壓縮質素級別。新版本還展現了跨平台的效能改進,以及減少解碼所需的主記憶體。[7]

2026年黑色十月(英語:Black October (information security))期間,受Node.js漏洞(node2shell)影響,Brotli亦有可利用的壓縮演算法漏洞[9][10][11],PHP、.NET及Linux陸續修補[12][13][14][15]。

演算法

[編輯]

與常見的通用壓縮演算法不同,Brotli使用一個預定義的120千位元組字典。該字典包含超過13000個常用單詞、短語和其他子字串,這些來自一個文字和HTML文件的大型語料庫。[16][17]預定義的演算法可以提升較小檔案的壓縮密度。

使用brotli取代deflate來對文字檔案壓縮通常可以增加20%的壓縮密度,而壓縮與解壓縮速度則大致不變。IANA的HTTP內容編碼登錄檔將br登記為Brotli壓縮數據格式,其參考規範為RFC 7932。[18]

使用

[編輯]

註解

[編輯]
  1. ^ Brotli's core is written in C, but it has bindings for Java, Python, C#, and Go.[3]

參見

[編輯]

參考資料

[編輯]
  1. ^ Release v1.2.1 · google/brotli. [2026年10月22日] (英語). 
  2. ^ brotli/README.md at master. 4 April 2017 [21 April 2017]. (原始內容存檔於2015-04-04) –透過GitHub. 
  3. ^ google/brotli - Brotli compression format. [11 August 2017]. (原始內容存檔於2016-06-29) –透過GitHub. 
  4. ^ RFC 7932 - Brotli Compressed Data Format. IETF. 2017-02-17 [2017-02-16]. (原始內容存檔於2017-01-29). 
  5. ^ Brotli Source Code - GitHub. github.com. [2016-07-01]. (原始內容存檔於2016-06-29). 
  6. ^ Slater-Robbins, Max. Chrome and Firefox are about to get a lot faster thanks to Google's new data compression algorithm. techspot.com. 20 Jan 2016 [20 Jan 2016]. (原始內容存檔於2016-05-30). 
  7. ^ 7.0 7.1 Google Open Source Blog: Introducing Brotli: a new compression algorithm for the internet. [2016-07-01]. (原始內容存檔於2016-06-19). 
  8. ^ Smaller Fonts with WOFF 2.0 and unicode-range. Google Developers Blog. 18 Feb 2015 [20 Jan 2016]. (原始內容存檔於2016-03-04). 
  9. ^ Khandelwal, Swati. Brotli Decoder Flaw Behind Node.js RCE Also Affects Bun, Python and Other Widely Used Software. The Hacker News. [2026-10-26] (英語). 
  10. ^ CVE-2026-111497. nvd.nist.gov. 2026-10-22 [2026-10-28] (英語). 
  11. ^ Masas, Ron. Node2Shell: From Brotli Data to Remote Code Execution | Imperva. Imperva Blog. 2026-10-22 [2026-10-28] (美國英語). 
  12. ^ RHSB-2026-015 Out-of-Bounds Write - Google Brotli Decoder (CVE-2026-111497) - "node2shell" | Red Hat Customer Portal. Reahat. 2026-10-22 [2026-10-28] (英語). 
  13. ^ Bhandari (MSFT), Rahul. .NET October 2026 Out-of-Band Security Updates. .NET Blog. 2026-10-25 [2026-10-28] (美國英語). 
  14. ^ Updated PHP Windows builds for Brotli security fix. PHP. 2026-10-26 [2026-10-28] (中文). 
  15. ^ CVE-2026-111497. security-tracker.debian.org. [2026-10-28]. 
  16. ^ Richard Chirgwin. Google's new squeeze: Brotli compression open-sourced. The Register. 23 September 2015 [2016-07-01]. (原始內容存檔於2016-05-02). 
  17. ^ Alakuijala, Jyrki; Kliuchnikov, Evgenii; Szabadka, Zoltan; Vandevenne, Lode. Comparison of Brotli, Deflate, Zopfli, LZMA, LZHAM and Bzip2 Compression Algorithms (PDF). Google. 2015-09-22 [25 October 2015]. (原始內容存檔 (PDF)於2016-02-09). 
  18. ^ Hypertext Transfer Protocol (HTTP) Parameters: Content Coding. Internet Assigned Numbers Authority. [2026-08-11] (英語). 
  19. ^ Firefox 44 release notes. mozilla.org. [2016-01-26]. (原始內容存檔於2016-03-04). 
  20. ^ 20.0 20.1 20.2 Can I use... Support tables for HTML5, CSS3, etc. caniuse.com. [2016-01-07]. (原始內容存檔於2017-04-08). 

外部連結

[編輯]