本文介绍了Google驱动器UI和API之间的谷歌驱动器使用统计差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我们正在使用Google Drive API的 但是,如果我们正在使用关于谷歌驱动器的资源回应将得到如下。 {quotaBytesTotal:16106127360,quotaBytesUsed:17108627,quotaBytesUsedAggregate:136771970,quotaBytesUsedInTrash:0, quotaBytesByService:[ {serviceName:DRIVE,bytesUsed:22255358}, {serviceName :GMAIL, bytesUsed:119663343}, {serviceName:PHOTOS,bytesUsed:0} } 驱动程序API的参考链接 about resource 。 解决方案 http://www.whatsabyte.com/P1/byteconverter.htm 22255358 = 21.22 Mb 119663343 = 114.11986 Mb 问题? 1Mb = 2 ^ 10 kb 1kb = 2 ^ 10 b(ytes) 你是对的,他们应该/可能已经使用了 Mib 1000字节 在国际单位制(SI)中,前缀千位表示1000 (103);因此在这个系统中一千字节是1000字节。单位符号为kB。 这是由国际电子技术委员会(IEC)推荐的定义。这个定义和前缀mega- = 1000000,giga- = 1000000000等相关的定义是,用于计算机网络,内部总线,硬盘中的数据传输速率[2]驱动器和闪存介质传输速度,以及大多数存储介质(特别是硬盘驱动器,[3]基于闪存的存储器[4]和DVD)的容量。这与计算中 SI前缀的其他用法也是一致的,例如CPU时钟速度或性能指标。 b $ b Mac OS X 10.6文件管理器是软件中此用法的一个显着示例。由于Snow Leopard,文件大小以十进制前缀报告[5]。 1024字节 在一些信息技术领域,kilobyte指的是到1024(210)字节。[6] [7] [8]这个用法源于妥协行话需要用2的幂来表达,但缺少一个方便的单位前缀。由于1024(210)接近1000 (103),因此相应的SI前缀用于表示1024的幂次的倍数。 由于二进制寻址,mega = 1048576(= 10242),等的定义和相关定义几乎总是用于随机存取存储器容量,如主存储器和CPU高速缓存大小的内存[a]千字节,兆字节等的这些二进制含义为,在报告磁盘容量和文件大小时,也被某些计算机操作系统使用。 [不可靠的源代码?] 1024字节的二进制表示通常使用符号KB (大写字母K)。 B在非正式使用中经常被省略。例如,具有65,536字节高速缓存的处理器可能被称为具有64K的高速缓存。 kibibyte主条目:Kibibyte 1998年12月,IEC通过创建诸如kibi,mebi,gibi等前缀,解决了这种多重用法和定义,到明确表示1024的幂。[10]因此,符号 KiB的kibibyte代表210 = 1024个字节。这些前缀现在是国际数量系统的一部分。 IEC进一步规定,千字节只能用于指1000字节。然而,千字节仍然常用于指1024字节。 https://en.wikipedia.org/wiki/Kilobyte We are using google drive API's About.Get method to return an Abount resource.In google drive statistics displayed as below.But if we are use About resource of google drive response will be getting as follow.{"quotaBytesTotal": "16106127360","quotaBytesUsed": "17108627","quotaBytesUsedAggregate": "136771970","quotaBytesUsedInTrash": "0","quotaBytesByService": [ { "serviceName": "DRIVE", "bytesUsed": "22255358" }, { "serviceName": "GMAIL", "bytesUsed": "119663343" }, { "serviceName": "PHOTOS", "bytesUsed": "0" }}Reference link for drive API's about resource. 解决方案 http://www.whatsabyte.com/P1/byteconverter.htm22255358 = 21.22 Mb119663343 = 114.11986 MbWhere is the issue ?1Mb = 2^10 kb1kb = 2^10 b(ytes)EDIT:you are right, they should/may have used 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.https://en.wikipedia.org/wiki/Kilobyte 这篇关于Google驱动器UI和API之间的谷歌驱动器使用统计差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-19 14:58