1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.internal.backends.chrome.crx_id</title> 4<meta charset="utf-8"> 5</head><body bgcolor="#f0f0f8"> 6 7<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 8<tr bgcolor="#7799ee"> 9<td valign=bottom> <br> 10<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.internal.html"><font color="#ffffff">internal</font></a>.<a href="telemetry.internal.backends.html"><font color="#ffffff">backends</font></a>.<a href="telemetry.internal.backends.chrome.html"><font color="#ffffff">chrome</font></a>.crx_id</strong></big></big></font></td 11><td align=right valign=bottom 12><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/internal/backends/chrome/crx_id.py">telemetry/internal/backends/chrome/crx_id.py</a></font></td></tr></table> 13 <p><tt>Read a CRX file and write out the App ID and the Full Hash of the ID.<br> 14See: <a href="http://code.google.com/chrome/extensions/crx.html">http://code.google.com/chrome/extensions/crx.html</a><br> 15and '<a href="http://stackoverflow.com/questions/">http://stackoverflow.com/questions/</a>'<br> 16 + '1882981/google-chrome-alphanumeric-hashes-to-identify-extensions'<br> 17for docs on the format.</tt></p> 18<p> 19<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 20<tr bgcolor="#aa55cc"> 21<td colspan=3 valign=bottom> <br> 22<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 23 24<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 25<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="base64.html">base64</a><br> 26</td><td width="25%" valign=top><a href="hashlib.html">hashlib</a><br> 27</td><td width="25%" valign=top><a href="json.html">json</a><br> 28</td><td width="25%" valign=top><a href="os.html">os</a><br> 29</td></tr></table></td></tr></table><p> 30<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 31<tr bgcolor="#eeaa77"> 32<td colspan=3 valign=bottom> <br> 33<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> 34 35<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> 36<td width="100%"><dl><dt><a name="-GetCRXAppID"><strong>GetCRXAppID</strong></a>(filename, from_file_path<font color="#909090">=False</font>, is_win_path<font color="#909090">=False</font>)</dt></dl> 37 <dl><dt><a name="-GetCRXHash"><strong>GetCRXHash</strong></a>(filename, from_file_path<font color="#909090">=False</font>, is_win_path<font color="#909090">=False</font>)</dt></dl> 38 <dl><dt><a name="-GetPublicKey"><strong>GetPublicKey</strong></a>(filename, from_file_path, is_win_path<font color="#909090">=False</font>)</dt></dl> 39 <dl><dt><a name="-GetPublicKeyFromPath"><strong>GetPublicKeyFromPath</strong></a>(filepath, is_win_path<font color="#909090">=False</font>)</dt></dl> 40 <dl><dt><a name="-GetPublicKeyPacked"><strong>GetPublicKeyPacked</strong></a>(f)</dt></dl> 41 <dl><dt><a name="-GetPublicKeyUnpacked"><strong>GetPublicKeyUnpacked</strong></a>(f, filepath)</dt></dl> 42 <dl><dt><a name="-HasPublicKey"><strong>HasPublicKey</strong></a>(filename)</dt></dl> 43 <dl><dt><a name="-HexTo256"><strong>HexTo256</strong></a>(hex_chars)</dt><dd><tt>Convert bytes to pairs of hex digits. E.g., -> "{0x00, 0x11}"<br> 44The format is taylored for copy and paste into C code:<br> 45const uint8 sha256_hash[] = { ... };</tt></dd></dl> 46 <dl><dt><a name="-HexToInt"><strong>HexToInt</strong></a>(hex_chars)</dt><dd><tt>Convert bytes like � -> 171</tt></dd></dl> 47 <dl><dt><a name="-HexToMPDecimal"><strong>HexToMPDecimal</strong></a>(hex_chars)</dt><dd><tt>Convert bytes to an MPDecimal string. Example -> "aa"<br> 48This gives us the AppID for a chrome extension.</tt></dd></dl> 49</td></tr></table><p> 50<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 51<tr bgcolor="#55aa55"> 52<td colspan=3 valign=bottom> <br> 53<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> 54 55<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> 56<td width="100%"><strong>EXPECTED_CRX_MAGIC_NUM</strong> = 'Cr24'<br> 57<strong>EXPECTED_CRX_VERSION</strong> = 2</td></tr></table> 58</body></html>