LoginSignup
3
2

More than 3 years have passed since last update.

UUIDとGUIDのオーダーについて

Last updated at Posted at 2019-08-17

多くのシステムでは、UUIDをBig-Endianとしてエンコードするが、
Microsoftの.NETで採用されているCOMなどをはじめとするシステムでは、
GUIDとして解釈するためMixed-Endianとしてエンコードするらしい。

それぞれのエンコード例

00112233-4455-6677-8899-aabbccddeeff
このUUIDを例として説明。

Big-Endiganとしてのエンコード例

Big-Endianなのでそのまま
00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ffという
オーダーとしてエンコードする。

Microsoft関連システム上でMixed-Endian(GUID)としてエンコードする例

最初の3つのコンポーネントをLittle-Endianとして解釈し、最後の2コンポーネントをBig-Endianとして解釈するらしい。

つまり、
33 22 11 00 55 44 77 66 88 99 aa bb cc dd ee ff
というオーダーで解釈される。

参考文献

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2