GUID
GUID (英: Globally Unique Identifier) またはグローバル一意識別子(ぐろーばるいちいしきべつし)は、UUIDの実装のひとつ�…
GUID (英: Globally Unique Identifier) またはグローバル一意識別子(ぐろーばるいちいしきべつし)は、UUIDの実装のひとつ、あるいは(事実上)UUIDの別名である。
UUIDのマイクロソフトによる実装を指すと解されることもあるが、オラクルのデータベースやNetIQのeDirectory(ディレクトリ・サービス)、GUIDパーティションテーブルなど、ほぼUUIDを指して、GUIDの語が使われることもある。
GUIDを生成するツールとして、Microsoft Windows SDKに付属する GuidGen [1]などがある。GuidGenはMicrosoft Visual Studioのメニューから呼び出すこともできる。Windows APIにはCoCreateGuid()関数[2]およびUuidCreate()関数[3]が用意されている。.NET FrameworkにはSystem.Guid.NewGuid()メソッドが用意されている[4]。
構造
GUID は16バイト (128ビット) の2進数値で、以下のような構造体で表現される。
GUID STRUCT Data1 dd Data2 dw Data3 dw Data4 db 8 GUID ENDS
<guiddef.h> におけるGUID構造体の定義は以下のとおり[5]。
typedef struct _GUID {
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
Microsoft Windowsでは16ビット/32ビット/64ビットいずれのターゲットプラットフォーム(CPUアーキテクチャ)においても、short型は常に16ビットであり、long型は常に32ビットである。
テキスト表記
GUIDの表記には一般に以下のような16進表記が使われる。
3F2504E0-4F89-11D3-9A0C-0305E82C3301
このテキスト表記は以下のような32桁の構造を持つ。
- Data1:
3F2504E0(8桁) - ハイフン
- Data2:
4F89(4桁) - ハイフン
- Data3:
11D3(4桁) - ハイフン
- Data4 の最初の2アイテム:
9A 0C(4桁) - ハイフン
- Data4 の残りの6アイテム:
03 05 E8 2C 33 01(12桁)
波括弧 (ブレース) で囲んで表記することも多い。
{3F2504E0-4F89-11D3-9A0C-0305E82C3301}
使用例
脚注
外部リンク
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.