「Webブラウザ(Chrome)」の版間の差分

Notion-MW
 
Notion-MW
24行目: 24行目:
この2.の部分は[https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/web_applications/web_app_helpers_unittest.cc ソースコード]に書いてある[https://play.golang.org/p/VrIq_QKFjiV playground]で試すこともできる。pythonで書くと以下のようになる(URLはコマンドライン引数として渡すことを想定)。
この2.の部分は[https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/web_applications/web_app_helpers_unittest.cc ソースコード]に書いてある[https://play.golang.org/p/VrIq_QKFjiV playground]で試すこともできる。pythonで書くと以下のようになる(URLはコマンドライン引数として渡すことを想定)。


<pre class="dummy_str_python">import hashlib
<syntaxhighlight lang="python">import hashlib


m = hashlib.sha256()
m = hashlib.sha256()
m.update(bytes(&quot;https://chat.openai.com/&quot;.encode('ascii')))
m.update(bytes("https://chat.openai.com/".encode('ascii')))
m1 = hashlib.sha256()
m1 = hashlib.sha256()
m1.update(m.digest())
m1.update(m.digest())


EXTID = ''.join([chr(int(i, base=16) + ord('a')) for i in m1.hexdigest()][:32])
EXTID = ''.join([chr(int(i, base=16) + ord('a')) for i in m1.hexdigest()][:32])
print(EXTID)</pre>
print(EXTID)</syntaxhighlight>
* 参考&#58; [https://stackoverflow.com/questions/26053434/how-is-the-chrome-extension-id-of-an-unpacked-extension-generated/26058672#26058672 How is the Chrome Extension ID of an unpacked extension generated? &#45; Stack Overflow]
* 参考&#58; [https://stackoverflow.com/questions/26053434/how-is-the-chrome-extension-id-of-an-unpacked-extension-generated/26058672#26058672 How is the Chrome Extension ID of an unpacked extension generated? &#45; Stack Overflow]