Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome extension id algorithm for local folder

What is the algorithm of extension id in Chrome for local folders? For instance, given extension inside /usr/mychromeextension , how I calculate its extension id ?

like image 286
NN_ Avatar asked Apr 15 '26 01:04

NN_


1 Answers

According to the source code in id_util.cc:

  1. SHA256 of the full path without trailing slash is calculated as a lowercase hex string.
    • in Windows the drive letter is uppercased if the path starts with one
    • in Windows UTF-16 encoding is used for the file path
  2. the first 32 hex digits of the hash string are used
  3. each hex digit is mapped from 0..f to a..p range:
    the decimal value of each hex digit is added to the ASCII code of lowercase a (97 decimal)

    We use the characters 'a'-'p' instead of '0'-'f' to avoid ever having a completely numeric host, since some software interprets that as an IP address.

like image 73
wOxxOm Avatar answered Apr 17 '26 14:04

wOxxOm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!