[原文] .TH "UUID_GENERATE" "3" "2021-06-02" "util-linux 2.37.2" "Programmer\(aqs Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \\$2 <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} [訳文] .TH UUID_GENERATE 3 2021-06-02 "util-linux 2.37.2" プãƒã‚°ãƒ©ãƒžãƒ¼ãƒžãƒ‹ãƒ¥ã‚¢ãƒ« .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \\$2 <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} ---------------------------------------- [原文] .SH "NAME" uuid_generate, uuid_generate_random, uuid_generate_time, uuid_generate_time_safe - create a new unique UUID value [訳文] .SH åå‰ uuid_generate, uuid_generate_random, uuid_generate_time, uuid_generate_time_safe - æ–°è¦ã«ä¸€æ„ã® UUID を生æˆã™ã‚‹ ---------------------------------------- [原文] .SH "SYNOPSIS" [訳文] .SH æ›¸å¼ ---------------------------------------- [原文] .sp #include <uuid.h> [訳文] .sp #include <uuid.h> ---------------------------------------- [原文] .sp void uuid_generate(uuid_t out); void uuid_generate_random(uuid_t out); void uuid_generate_time(uuid_t out); int uuid_generate_time_safe(uuid_t out); void uuid_generate_md5(uuid_t out, const uuid_t \fIns, const char *name, size_t len);\fP void uuid_generate_sha1(uuid_t out, const uuid_t \fIns, const char *name, size_t len);\fP [訳文] .sp void uuid_generate(uuid_t out); void uuid_generate_random(uuid_t out); void uuid_generate_time(uuid_t out); int uuid_generate_time_safe(uuid_t out); void uuid_generate_md5(uuid_t out, const uuid_t ns, const char *name, size_t len); void uuid_generate_sha1(uuid_t out, const uuid_t ns, const char *name, size_t len); ---------------------------------------- [原文] .SH "DESCRIPTION" [訳文] .SH 説明 ---------------------------------------- [原文] .sp The uuid_generate() function creates a new universally unique identifier (UUID). The uuid will be generated based on high-quality randomness from getrandom(2), /dev/urandom, or /dev/random if available. If it is not available, then uuid_generate() will use an alternative algorithm which uses the current time, the local ethernet MAC address (if available), and random data generated using a pseudo-random generator. [訳文] .sp uuid_generate() 関数ã¯ã€ æ–°ãŸãª UUID (universally unique identifier) を生æˆã™ã‚‹ã€‚ UUID ã®ç”Ÿæˆã«ã‚ãŸã£ã¦ã¯ã€ getrandom(2)〠/dev/urandom〠/dev/random ã®ä¸ã®åˆ©ç”¨å¯èƒ½ãªã‚‚ã®ãŒç”¨ã„られ〠高å“質ãªä¹±æ•°ãŒç”Ÿæˆã•れる。 ã“れãŒåˆ©ç”¨ã§ããªã„å ´åˆã€ uuid_generate() ã¯ã€ ã“れã«ä»£ã‚るアルゴリズムを採用ã™ã‚‹ã€‚ ãã“ã§ã¯ã€ ç¾åœ¨æ™‚刻〠ãƒãƒ¼ã‚«ãƒ«ã‚¤ãƒ¼ã‚µãƒãƒƒãƒˆã® MAC アドレス (利用ã§ãã‚‹å ´åˆ)〠疑似乱数ジェãƒãƒ¬ãƒ¼ã‚¿ãƒ¼ã‚’使ã£ã¦ç”Ÿæˆã•れる乱数データを利用ã™ã‚‹ 。 ---------------------------------------- [原文] .sp The uuid_generate_random() function forces the use of the all-random UUID format, even if a high-quality random number generator is not available, in which case a pseudo-random generator will be substituted. Note that the use of a pseudo-random generator may compromise the uniqueness of UUIDs generated in this fashion. [訳文] .sp uuid_generate_random() 関数ã¯ã€ 高å“質ã®ä¹±æ•°ã‚¸ã‚§ãƒãƒ¬ãƒ¼ã‚¿ãƒ¼ãŒåˆ©ç”¨ã§ããªã„å ´åˆã§ã‚ã£ã¦ã‚‚ã€å®Œå…¨ ãªãƒ©ãƒ³ãƒ€ãƒ UUID フォーマットを強制的ã«åˆ©ç”¨ã™ã‚‹ã€‚ ã“ã®å ´åˆã¯ã€ 疑似乱数ジェãƒãƒ¬ãƒ¼ã‚¿ãƒ¼ãŒä»£ã‚りã«ç”¨ã„られる。 ãŸã ã—疑似乱数ジェãƒãƒ¬ãƒ¼ã‚¿ãƒ¼ã‚’用ã„ã‚‹ã¨ã€ 生æˆã•れる UUID ã®ä¸€æ„æ€§ã¯æãªã‚ã‚Œã‚‹å ´åˆãŒã‚ã‚‹ã“ã¨ã«æ³¨æ„ã™ã‚‹ã“ã¨ã€‚ ---------------------------------------- [原文] .sp The uuid_generate_time() function forces the use of the alternative algorithm which uses the current time and the local ethernet MAC address (if available). This algorithm used to be the default one used to generate UUIDs, but because of the use of the ethernet MAC address, it can leak information about when and where the UUID was generated. This can cause privacy problems in some applications, so the uuid_generate() function only uses this algorithm if a high-quality source of randomness is not available. To guarantee uniqueness of UUIDs generated by concurrently running processes, the uuid library uses a global clock state counter (if the process has permissions to gain exclusive access to this file) and/or the uuidd daemon, if it is running already or can be spawned by the process (if installed and the process has enough permissions to run it). If neither of these two synchronization mechanisms can be used, it is theoretically possible that two concurrently running processes obtain the same UUID(s). To tell whether the UUID has been generated in a safe manner, use uuid_generate_time_safe. [訳文] .sp uuid_generate_time() 関数ã¯ã€ ç¾åœ¨æ™‚刻㨠(利用å¯èƒ½ã§ã‚れã°) ãƒãƒ¼ã‚«ãƒ«ã®ã‚¤ãƒ¼ã‚µãƒãƒƒãƒˆ MAC アドレスを用ã„ãŸã€ 別ã®ã‚¢ãƒ«ã‚´ãƒªã‚ºãƒ を強制的ã«åˆ©ç”¨ã™ã‚‹ã€‚ ã“ã®ã‚¢ãƒ«ã‚´ãƒªã‚ºãƒ ã¯ã€ ã‹ã¤ã¦ã¯ UUID を生æˆã™ã‚‹ãƒ‡ãƒ•ォルトã§ã‚ã£ãŸã€‚ ãŸã ã—イーサãƒãƒƒãƒˆ MAC アドレスを利用ã™ã‚‹ã“ã¨ã‹ã‚‰ã€ ã„ã¤ã©ã“ã§ UUID ãŒç”Ÿæˆã•れãŸã‚‚ã®ã§ã‚ã‚‹ã‹ã®æƒ…å ±ãŒæ¼ã‚Œã¦ã—ã¾ã†ã€‚ アプリケーションã«ã‚ˆã£ã¦ã¯ã€ プライãƒã‚·ãƒ¼ã®å•題を引ãèµ·ã“ã™å ´åˆãŒã‚る。 ãã“ã§ uuid_generate() 関数ã¯ã€ 高å“質ã®ä¹±æ•°ç™ºç”Ÿã®ä»•組ã¿ãŒåˆ©ç”¨ã§ããªã„å ´åˆã«é™ã£ã¦ã€ ã“ã®ã‚¢ãƒ«ã‚´ãƒªã‚ºãƒ を利用ã—ã¦ã„る。 並列実行ã•れã¦ã„るプãƒã‚»ã‚¹ã‹ã‚‰ç”Ÿæˆã•れる UUID ã§ã‚ã£ã¦ã‚‚〠ãã®ä¸€æ„性をä¿è¨¼ã™ã‚‹ãŸã‚ã«ã€ uuid ライブラリã§ã¯ã€ ã‚°ãƒãƒ¼ãƒãƒ«ã‚¯ãƒãƒƒã‚¯ã®çŠ¶æ…‹ã‚«ã‚¦ãƒ³ã‚¿ãƒ¼ (status counter) を利用ã™ã‚‹ (プãƒã‚»ã‚¹ãŒã€ ã“ã®ãƒ•ァイルã¸ã®æŽ’他的アクセス権é™ã‚’å–å¾—ã§ãã‚‹å ´åˆ)。 ã¾ãŸã¯ uuidd デーモンを利用ã™ã‚‹ (ã“れãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã„ã¦ã€ プãƒã‚»ã‚¹ãŒãã®å®Ÿè¡Œæ¨©é™ã‚’æŒã£ã¦ã„ã‚‹å ´åˆ)。 ã“ã® 2 ã¤ã®åŒæœŸã®ãƒ¡ã‚«ãƒ‹ã‚ºãƒ ãŒã¨ã‚‚ã«åˆ©ç”¨ã§ããªã„å ´åˆã€ 2 ã¤ã®åŒæ™‚実行ã•れãŸãƒ—ãƒã‚»ã‚¹ãŒã€ åŒä¸€ã® UUID ã‚’å–å¾—ã™ã‚‹ã“ã¨ã¯ã€ ç†è«–çš„ã«ã¯å¯èƒ½ã«ãªã‚‹ã€‚ UUID ãŒå®‰å…¨ãªæ–¹æ³•ã§ç”Ÿæˆã•れãŸã“ã¨ã‚’確èªã™ã‚‹ã«ã¯ã€ uuid_generate_time_safe を用ã„ã‚‹ã“ã¨ã€‚ ---------------------------------------- [原文] .sp The uuid_generate_time_safe() function is similar to uuid_generate_time(), except that it returns a value which denotes whether any of the synchronization mechanisms (see above) has been used. [訳文] .sp uuid_generate_time_safe() 関数㯠uuid_generate_time() ã¨åŒæ§˜ã§ã‚る。 ãŸã ã—関数ã®è¿”り値ã¨ã—ã¦ã€ ã©ã®åŒæœŸãƒ¡ã‚«ãƒ‹ã‚ºãƒ (å‰è¿°å‚ç…§) を用ã„ãŸã®ã‹ã‚’表ã™å€¤ã‚’è¿”ã™ã€‚ ---------------------------------------- [原文] .sp The UUID is 16 bytes (128 bits) long, which gives approximately 3.4x10^38 unique values (there are approximately 10^80 elementary particles in the universe according to Carl Sagan\(cqs Cosmos). The new UUID can reasonably be considered unique among all UUIDs created on the local system, and among UUIDs created on other systems in the past and in the future. [訳文] .sp UUID 㯠16 ãƒã‚¤ãƒˆé•· (128 ビット) ã§ã‚り〠ãŠã‚ˆã 3.4x10^38 個ã®ä¸€æ„ãªå€¤ã‚’æä¾›ã™ã‚‹ (Carl Sagan ã® Cosmos ã«ã‚ˆã‚‹ã¨ã€å®‡å®™ã«ã¯ 10^38 個ã®ç´ ç²’åãŒã‚ã‚‹ã¨ã®ã“ã¨)。 æ–°ãŸã«ç”Ÿæˆã•れ㟠UUID ã¯ã€ ãƒãƒ¼ã‚«ãƒ«ã‚·ã‚¹ãƒ†ãƒ 内ã«ç”Ÿæˆã•れã¦ã„ã‚‹ UUID ã«å¯¾ã—ã¦ä¸€æ„ã§ã‚り〠ã¾ãŸéŽåŽ»ã‹ã‚‰æœªæ¥ã«å‘ã‘ã¦ã€ ä»–ã®ã‚·ã‚¹ãƒ†ãƒ 上ã«ãŠã„ã¦ç”Ÿæˆã•れる UUID ã«å¯¾ã—ã¦ã‚‚一æ„ã¨ãªã‚‹ã€ ã¨è€ƒãˆã¦ã‹ã¾ã‚ãªã„。 ---------------------------------------- [原文] .sp The uuid_generate_md5() and uuid_generate_sha1() functions generate an MD5 and SHA1 hashed (predictable) UUID based on a well-known UUID providing the namespace and an arbitrary binary string. The UUIDs conform to V3 and V5 UUIDs per \c .URL "https://tools.ietf.org/html/rfc4122" "RFC-4122" "." [訳文] .sp uuid_generate_md5() 関数ãŠã‚ˆã³ uuid_generate_sha1() 関数ã¯ã€ åå‰ç©ºé–“ãŠã‚ˆã³ä»»æ„ã®ãƒã‚¤ãƒŠãƒªæ–‡å—列をæä¾›ã™ã‚‹æ—¢çŸ¥ã® UUID ã«åŸºã¥ã„ãŸã€ MD5 ãƒãƒƒã‚·ãƒ¥ã€ SHA1 ãƒãƒƒã‚·ãƒ¥ã® (予測å¯èƒ½ãª) UUID ã‚’æä¾›ã™ã‚‹ã€‚ UUID ã¯ã€ 以下㮠V3 ãŠã‚ˆã³ V5 ã«æº–æ‹ ã—ã¦ã„る。 .URL https://tools.ietf.org/html/rfc4122 RFC-4122 . ---------------------------------------- [原文] .SH "RETURN VALUE" [訳文] .SH 返り値 ---------------------------------------- [原文] .sp The newly created UUID is returned in the memory location pointed to by out. uuid_generate_time_safe() returns zero if the UUID has been generated in a safe manner, -1 otherwise. [訳文] .sp æ–°ãŸã«ç”Ÿæˆã•れ㟠UUID ã¯ã€ out ã«ã‚ˆã£ã¦ç¤ºã•れるメモリ上ã®å ´æ‰€ã«è¿”ã•れる。 UUID ãŒå®‰å…¨ãªæ–¹æ³•ã§ç”Ÿæˆã•れãŸã‚‰ 0 ã‚’è¿”ã™ã€‚ ãã†ã§ãªã„å ´åˆã¯ -1 ã‚’è¿”ã™ã€‚ ---------------------------------------- [原文] .SH "CONFORMING TO" [訳文] .SH æº–æ‹ ---------------------------------------- [原文] .sp This library generates UUIDs compatible with OSF DCE 1.1, and hash based UUIDs V3 and V5 compatible with \c .URL "https://tools.ietf.org/html/rfc4122" "RFC-4122" "." [訳文] .sp 本ライブラリ㯠OSF DCE 1.1 ã¨äº’æ›ã® UUID を生æˆã™ã‚‹ã€‚ ã¾ãŸãƒãƒƒã‚·ãƒ¥ãƒ™ãƒ¼ã‚¹ UUID V3 㨠V5 ã¯ã€ 以下ã¨äº’æ›ã§ã‚ã‚‹: .URL https://tools.ietf.org/html/rfc4122 RFC-4122 . ---------------------------------------- [原文] .SH "AUTHORS" [訳文] .SH 著者 ---------------------------------------- [原文] .sp Theodore Y. Ts\(cqo [訳文] .sp Theodore Y. Ts\(cqo ---------------------------------------- [原文] .SH "SEE ALSO" [訳文] .SH é–¢é€£é …ç›® ---------------------------------------- [原文] .sp uuidgen(1), uuid(3), uuid_clear(3), uuid_compare(3), uuid_copy(3), uuid_is_null(3), uuid_parse(3), uuid_time(3), uuid_unparse(3), uuidd(8) [訳文] .sp uuidgen(1), uuid(3), uuid_clear(3), uuid_compare(3), uuid_copy(3), uuid_is_null(3), uuid_parse(3), uuid_time(3), uuid_unparse(3), uuidd(8) ---------------------------------------- [原文] .SH "REPORTING BUGS" [訳文] .SH ãƒã‚°å ±å‘Š ---------------------------------------- [原文] .sp For bug reports, use the issue tracker at \c .URL "https://github.com/karelzak/util-linux/issues" "" "." [訳文] .sp ãƒã‚°å ±å‘Šã¯ã€ 以下ã«ã‚ã‚‹ issue トラッカーを利用ã™ã‚‹ã“ã¨ã€‚ .URL https://github.com/karelzak/util-linux/issues "" . ---------------------------------------- [原文] .SH "AVAILABILITY" [訳文] .SH 入手方法 ---------------------------------------- [原文] .sp The libuuid library is part of the util-linux package since version 2.15.1. It can be downloaded from \c .URL "https://www.kernel.org/pub/linux/utils/util-linux/" "Linux Kernel Archive" "." [訳文] .sp libuuid ライブラリã¯ã€ util-linux 2.15.1 以é™ã€ ã“ã®ãƒ‘ッケージã®ä¸€éƒ¨ã§ã‚り〠以下ã‹ã‚‰ãƒ€ã‚¦ãƒ³ãƒãƒ¼ãƒ‰ã§ãる。 .URL https://www.kernel.org/pub/linux/utils/util-linux/ "Linux Kernel Archive" . ----------------------------------------