Google google 驱动器 UI 和 API 之间的驱动器使用统计差异
Google drive usage statistics difference between google drive UI and API
我们正在使用 google 驱动器 API 的 About.Get method to return an Abount resource。
在 google 驱动器统计信息显示如下。
但是如果我们使用 google 的 About 资源,驱动器响应将如下所示。
{
"quotaBytesTotal": "16106127360",
"quotaBytesUsed": "17108627",
"quotaBytesUsedAggregate": "136771970",
"quotaBytesUsedInTrash": "0",
"quotaBytesByService": [
{
"serviceName": "DRIVE",
"bytesUsed": "22255358"
},
{
"serviceName": "GMAIL",
"bytesUsed": "119663343"
},
{
"serviceName": "PHOTOS",
"bytesUsed": "0"
}
}
参考 link 驱动器 API 的 about resource。
http://www.whatsabyte.com/P1/byteconverter.htm
22255358 = 21.22 Mb
119663343 = 114.11986 Mb
问题出在哪里?
1Mb = 2^10kb
1kb = 2^10 b(字节)
编辑:
你是对的,他们 should/may 使用了 Mib
1000 bytes
In the International System of Units (SI) the prefix kilo- means 1000
(103); therefore one kilobyte is 1000 bytes in this system. The unit
symbol is kB.
This is the definition recommended by the International
Electrotechnical Commission (IEC).[1] This definition, and related
definitions of prefixes mega- = 1000000, giga- = 1000000000, etc., are
used for data transfer rates[2] in computer networks, internal bus,
hard drive and flash media transfer speeds, and for the capacities of
most storage media, particularly hard drives,[3] flash-based
storage,[4] and DVDs. It is also consistent with the other uses of the
SI prefixes in computing, such as CPU clock speeds or measures of
performance.
The Mac OS X 10.6 file manager is a notable example of this usage in
software. Since Snow Leopard, file sizes are reported with decimal
prefixes.[5] 1024 bytes
In some fields of information technology, the kilobyte instead refers
to 1024 (210) bytes.[6][7][8] This usage originated as compromise
jargon for multiples that needed to be expressed in powers of 2, but
lacked a convenient unit prefix. As 1024 (210) approximates 1000
(103), the corresponding SI prefixes were used for the multiples that
represent powers of 1024.
This definition, and related definitions of mega = 1048576 (=10242),
etc., are almost invariably used for random-access memory capacities,
such as main memory and CPU cache sizes, due to the binary addressing
of memory.[a] These "binary meanings" of kilobyte, megabyte, etc., are
also used by some computer operating systems when reporting disk
capacities and file sizes.[9][unreliable source?]
The binary representation of 1024 bytes typically uses the symbol KB
(uppercase K). The B is often omitted in informal use. For example, a
processor with 65,536 bytes of cache might be said to have "64K" of
cache. kibibyte Main article: Kibibyte
In December 1998, the IEC addressed such multiple usages and
definitions by creating prefixes such as kibi, mebi, gibi, etc., to
unambiguously denote powers of 1024.[10] Thus the kibibyte, symbol
KiB, represents 210 = 1024 bytes. These prefixes are now part of the
International System of Quantities. The IEC further specified that the
kilobyte should only be used to refer to 1000 bytes. However, the
kilobyte is still commonly used to refer to 1024 bytes.
我们正在使用 google 驱动器 API 的 About.Get method to return an Abount resource。
在 google 驱动器统计信息显示如下。
但是如果我们使用 google 的 About 资源,驱动器响应将如下所示。
{
"quotaBytesTotal": "16106127360",
"quotaBytesUsed": "17108627",
"quotaBytesUsedAggregate": "136771970",
"quotaBytesUsedInTrash": "0",
"quotaBytesByService": [
{
"serviceName": "DRIVE",
"bytesUsed": "22255358"
},
{
"serviceName": "GMAIL",
"bytesUsed": "119663343"
},
{
"serviceName": "PHOTOS",
"bytesUsed": "0"
}
}
参考 link 驱动器 API 的 about resource。
http://www.whatsabyte.com/P1/byteconverter.htm
22255358 = 21.22 Mb
119663343 = 114.11986 Mb
问题出在哪里?
1Mb = 2^10kb 1kb = 2^10 b(字节)
编辑: 你是对的,他们 should/may 使用了 Mib
1000 bytes
In the International System of Units (SI) the prefix kilo- means 1000 (103); therefore one kilobyte is 1000 bytes in this system. The unit symbol is kB.
This is the definition recommended by the International Electrotechnical Commission (IEC).[1] This definition, and related definitions of prefixes mega- = 1000000, giga- = 1000000000, etc., are used for data transfer rates[2] in computer networks, internal bus, hard drive and flash media transfer speeds, and for the capacities of most storage media, particularly hard drives,[3] flash-based storage,[4] and DVDs. It is also consistent with the other uses of the SI prefixes in computing, such as CPU clock speeds or measures of performance.
The Mac OS X 10.6 file manager is a notable example of this usage in software. Since Snow Leopard, file sizes are reported with decimal prefixes.[5] 1024 bytes
In some fields of information technology, the kilobyte instead refers to 1024 (210) bytes.[6][7][8] This usage originated as compromise jargon for multiples that needed to be expressed in powers of 2, but lacked a convenient unit prefix. As 1024 (210) approximates 1000 (103), the corresponding SI prefixes were used for the multiples that represent powers of 1024.
This definition, and related definitions of mega = 1048576 (=10242), etc., are almost invariably used for random-access memory capacities, such as main memory and CPU cache sizes, due to the binary addressing of memory.[a] These "binary meanings" of kilobyte, megabyte, etc., are also used by some computer operating systems when reporting disk capacities and file sizes.[9][unreliable source?]
The binary representation of 1024 bytes typically uses the symbol KB (uppercase K). The B is often omitted in informal use. For example, a processor with 65,536 bytes of cache might be said to have "64K" of cache. kibibyte Main article: Kibibyte
In December 1998, the IEC addressed such multiple usages and definitions by creating prefixes such as kibi, mebi, gibi, etc., to unambiguously denote powers of 1024.[10] Thus the kibibyte, symbol KiB, represents 210 = 1024 bytes. These prefixes are now part of the International System of Quantities. The IEC further specified that the kilobyte should only be used to refer to 1000 bytes. However, the kilobyte is still commonly used to refer to 1024 bytes.