This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch tor-browser-91.9.0esr-11.5-1 in repository tor-browser.
commit dce69bdadefe0db9c3ac680df788e3ea95b8258b Author: Richard Pospesel richard@torproject.org AuthorDate: Tue May 3 22:24:19 2022 +0000
fixup! Bug 31286: Implementation of bridge, proxy, and firewall settings in about:preferences#connection
CreaBug 40860: te shortlist of unicode emoji for bridge-moji feature --- .../torpreferences/content/connectionPane.js | 279 ++------------------- 1 file changed, 20 insertions(+), 259 deletions(-)
diff --git a/browser/components/torpreferences/content/connectionPane.js b/browser/components/torpreferences/content/connectionPane.js index dfb8b00d81384..46fbbfecf832f 100644 --- a/browser/components/torpreferences/content/connectionPane.js +++ b/browser/components/torpreferences/content/connectionPane.js @@ -1079,272 +1079,33 @@ function makeBridgeId(bridgeString) { // JS uses UTF-16. While most of these emojis are surrogate pairs, a few // ones fit one UTF-16 character. So we could not use neither indices, // nor substr, nor some function to split the string. - const emojis = [ - "๐๏ธ", - "๐๏ธ", - "๐", - "๐ญ๏ธ", - "๐๏ธ", - "๐๏ธ", - "๐คฉ๏ธ", - "๐", - "๐๏ธ", - "๐๏ธ", - "๐ท", - "๐คข", - "๐ค", - "๐คง", - "๐ฅต", - "๐ฅถ", - "๐ฅด", - "๐ต๏ธ", - "๐คฎ๏ธ", - "๐ค", - "๐ค", - "๐ซข", - "๐ค", - "๐ฎโ๐จ", - "๐", - "๐คค", - "๐ด", - "๐คฏ", - "๐ค ", - "๐ฅณ", - "๐ฅธ", - "๐ค", - "๐ง", - "๐จ", - "๐ณ", - "๐ฅบ", - "๐คฌ", - "๐", - "๐ฟ", - "๐", - "๐ฉ", - "๐คก", - "๐บ", - "๐ป", - "๐ฝ", - "๐ฆด", - "๐ค", - "๐ธ", - "๐", - "๐", - "๐", - "๐", - "๐", - "๐ฏ", - "๐ข", - "๐ง", - "๐จ", - "๐ญ", - "๐ค", - "๐", - "๐", - "โ", - "๐", - "๐", - "๐ค", - "๐", - "๐ช", - "๐", - "โ", - "๐ง ", - "๐", - "๐", - "๐ ", - "๐ฆท", - "๐พ", - "๐ถ", - "๐ฆ", - "๐ฆ", - "๐", - "๐ฆ", - "๐ฏ", - "๐ด", - "๐ฆ", - "๐ฆ", - "๐ฎ", - "๐ท", - "๐", - "๐ช", - "๐", - "๐ญ", - "๐ฐ", - "๐ฆ", - "๐ฆ", - "๐ป", - "๐จ", - "๐ผ", - "๐", - "๐ฆจ", - "๐ฆ", - "๐ฆ", - "๐ง", - "๐ฆฉ", - "๐ฆ", - "๐ฆ", - "๐ชถ", - "๐ธ", - "๐", - "๐ข", - "๐ฆ", - "๐", - "๐ฆ", - "๐ฆ", - "๐ฌ", - "๐", - "๐", - "๐", - "๐", - "๐ธ", - "๐ฒ", - "๐ต", - "๐", - "๐", - "๐", - "๐", - "๐", - "๐", - "๐", - "๐", - "๐", - "๐ฅฅ", - "๐", - "๐", - "๐", - "๐ซ", - "๐ฅ", - "๐ฅ", - "๐ฅ", - "๐ง ", - "๐ฐ", - "๐", - "๐", - "๐ฅ", - "๐ง", - "๐", - "๐", - "๐", - "๐", - "๐ฅ", - "๐ฟ", - "๐ง", - "๐", - "๐ฆ", - "๐ฉ", - "๐ช", - "๐", - "๐ฌ", - "๐ญ", - "๐ฅ", - "โ", - "๐ซ", - "๐พ", - "๐ท", - "๐น", - "๐บ", - "๐ด", - "๐ฅ", - "๐ซ", - "๐งญ", - "๐", - "๐ชต", - "๐ก", - "๐ข", - "๐ฐ", - "โฒ", - "โบ", - "๐ก", - "๐", - "๐", - "๐", - "๐ฒ", - "๐", - "๐จ", - "โฝ", - "๐ฅ", - "๐ง", - "โ", - "โต", - "๐", - "๐ช", - "๐", - "โ", - "โฐ", - "๐", - "๐", - "๐", - "๐", - "โ ", - "โก", - "๐ฅ", - "๐", - "๐", - "๐", - "๐", - "โจ", - "๐", - "๐", - "๐", - "๐ ", - "๐ฎ", - "๐ช", - "๐พ", - "๐ณ", - "๐ฒ", - "๐ญ", - "๐จ", - "๐งต", - "๐ฉ", - "๐ข", - "๐", - "๐ต", - "๐ค", - "๐ง", - "๐ท", - "๐ธ", - "๐ฅ", - "๐", - "๐", - "๐ป", - "๐พ", - "๐ฟ", - "๐ฌ", - "๐บ", - "๐ท", - "๐ฎ", - "๐งฉ", - "๐", - "๐ก", - "๐", - "๐ฐ", - "๐ผ", - "๐", - "๐", - "๐", - "๐", - "๐", - "๐ง", - "๐ช", - "๐ฉ", - "๐งฒ", - "๐ฌ", - "๐ญ", - "๐ก", - "๐ช", - "๐ช", - "โ", - "๐ฉ", +const emojis = [ + "๐ฝ","๐ค","๐ง","๐ง","๐","๐ต","๐ฆ","๐ถ","๐บ","๐ฆ","๐","๐ฆ","๐ฏ","๐ด","๐ฆ","๐ฆ", + "๐ฆ","๐ฎ","๐ท","๐","๐","๐ฆ","๐ฆ","๐","๐ญ","๐น","๐","๐ฟ","๐ฆ","๐จ","๐ผ","๐ฆฅ", + "๐ฆจ","๐ฆ","๐","๐ฅ","๐ฆ","๐ง","๐","๐ฆ","๐ฆข","๐ฆ","๐ฆค","๐ฆฉ","๐ฆ","๐ฆ","๐","๐ข", + "๐ฆ","๐","๐","๐ฆ","๐ฆ","๐","๐ฌ","๐","๐ ","๐ก","๐ฆ","๐","๐","๐","๐ฆ","๐", + "๐","๐","๐","๐ธ","๐น","๐บ","๐ป","๐ผ","๐ท","๐ฑ","๐ฒ","๐ณ","๐ด","๐ต","๐ฟ","๐", + "๐","๐","๐","๐","๐","๐","๐ฅญ","๐","๐","๐","๐","๐","๐ฅ","๐ ","๐ฅฅ","๐ฅ", + "๐","๐ฅ","๐ฝ","๐ถ","๐ฅฌ","๐ฅฆ","๐ง ","๐","๐ฅ","๐ฅ","๐ฅ","๐ฅจ","๐ฅ","๐ง","๐","๐", + "๐ญ","๐ฎ","๐ฏ","๐ฅ","๐ฟ","๐","๐ฅ","๐ฆ","๐ฆ","๐ฆ","๐ฆ","๐ฉ","๐ง","๐ฌ","๐ญ","๐ง", + "๐ง","๐งญ","โฐ","๐","๐","๐ก","โฒ","โบ","๐ ","๐ก","๐","๐","๐","๐","๐","๐", + "๐","๐ต","๐บ","๐ฒ","๐ด","๐น","โ๏ธ","โต","๐ถ","๐ค","๐ข","โ๏ธ","๐ช","๐","๐ ","๐ฐ", + "๐","๐ธ","โณ","๐","๐ก","โ๏ธ","๐ช","โญ","โ๏ธ","๐ง","๐ฉ","๐","๐","โ๏ธ","โ๏ธ","โ๏ธ", + "๐ฅ","๐ง","๐","๐","โจ","๐","๐","๐","๐","๐","๐","โฝ","๐","๐","๐พ","๐ฅ", + "๐","โธ","๐ช","๐ช","๐ฑ","๐ฎ","๐ช","๐น","๐ฒ","๐งฉ","๐งธ","๐จ","๐งต","๐งถ","๐ถ","๐งฆ", + "๐","๐","๐ ","๐","๐","๐งข","๐","๐","๐ข","๐ต","๐","๐ค","๐ง","๐ป","๐ท","๐ช", + "๐ธ","๐บ","๐ป","๐ช","๐ฅ","โ๏ธ","๐ฟ","๐ฅ","๐ฌ","๐บ","๐ท","๐","๐ก","๐ฆ","๐","๐", + "๐ท","โ๏ธ","๐","๐","๐","๐","๐","๐ช","๐น","โ๏ธ","๐งฒ","๐งช","๐งฌ","๐ญ","๐ก","๐ฟ", ];
+ // FNV-1a implementation that is compatible with other languages const prime = 0x01000193; const offset = 0x811c9dc5; let hash = offset; const encoder = new TextEncoder(); - for (const charCode of encoder.encode(bridgeString)) { - hash = Math.imul(hash ^ charCode, prime); + for (const byte of encoder.encode(bridgeString)) { + hash = Math.imul(hash ^ byte, prime); }
const hashBytes = [