{"id":443,"date":"2022-09-01T09:59:34","date_gmt":"2022-09-01T00:59:34","guid":{"rendered":"https:\/\/www.b64.pw\/blog\/?p=443"},"modified":"2022-09-01T09:59:35","modified_gmt":"2022-09-01T00:59:35","slug":"ulid%e3%81%ae%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa%e3%82%92v1-0-2%e3%81%ab%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88%e3%81%97%e3%81%9f","status":"publish","type":"post","link":"https:\/\/www.b64.pw\/blog\/?p=443","title":{"rendered":"ULID\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092v1.0.2\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u305f"},"content":{"rendered":"\n<p>\u4e3b\u306a\u5909\u66f4\u70b9\u306fBASE32\u306b\u4f7f\u3063\u3066\u3044\u308b\u6587\u5b57\u7a2e\u5909\u66f4\u3067\u3059\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/www.php.net\/manual\/ja\/function.base-convert.php\">base_convert()<\/a>\u3092\u3064\u304b\u3063\u3066\u4e0b\u8a18\u3067\u751f\u6210\u3057\u3066\u3044\u305f\u306e\u3092<\/p>\n\n\n\n<p>0123456789ABCDEFGHIJKLMNOPQRSTUV<\/p>\n\n\n\n<p>\u4e92\u63db\u6027\u3092\u8003\u616e\u3057\u3066 <a href=\"https:\/\/github.com\/ulid\/spec\">https:\/\/github.com\/ulid\/spec<\/a> \u306b\u8a18\u8f09\u304c\u3042\u308b<\/p>\n\n\n\n<p>0123456789ABCDEFGHJKMNPQRSTVWXYZ<\/p>\n\n\n\n<p>\u306b\u5909\u66f4\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u307e\u305fULID\u306esort<a href=\"https:\/\/github.com\/ulid\/spec#sorting\" target=\"_blank\" rel=\"noreferrer noopener\">\u4ed5\u69d8<\/a>\u306b\u306f<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>Sorting\nThe left-most character must be sorted first, and the right-most character sorted last (lexical order). The default ASCII character set must be used. Within the same millisecond, sort order is not guaranteed<\/code><\/pre><\/div>\n\n\n\n<p>\u3068\u3042\u308a\u540c\u4e00\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306e\u9593\u306f\u30bd\u30fc\u30c8\u9806\u306f\u4fdd\u8a3c\u3057\u306a\u3044\u3068\u3042\u308b\u306e\u3067\u3059\u304c(\u307b\u304b\u306e\u5b9f\u88c5\u3082\u3053\u306e\u3042\u305f\u308a\u307e\u3061\u307e\u3061)<\/p>\n\n\n\n<p>\u540c\u3058\u304fULID\u306eMonotonicity\u306e<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/ulid\/spec#monotonicity\" target=\"_blank\">\u4ed5\u69d8<\/a> \u306b\u306f<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>When generating a ULID within the same millisecond, we can provide some guarantees regarding sort order. Namely, if the same millisecond is detected, the random component is incremented by 1 bit in the least significant bit position (with carrying). For example:\n\nimport { monotonicFactory } from &#39;ulid&#39;\n\nconst ulid = monotonicFactory()\n\n\/\/ Assume that these calls occur within the same millisecond\nulid() \/\/ 01BX5ZZKBKACTAV9WEVGEMMVRZ\nulid() \/\/ 01BX5ZZKBKACTAV9WEVGEMMVS0<\/code><\/pre><\/div>\n\n\n\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u30df\u30ea\u79d2\u5358\u4f4d\u3067\u540c\u4e00\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3067\u3042\u3063\u305f\u3089\u5f8c\u534a80bit\u306e\u5024\u306f\u4e71\u6570\u3067\u751f\u6210\u3067\u306f\u306a\u304f\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30c8\u3059\u308b\u3088\u3046\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3002\u77db\u76fe\u3059\u308b\u3088\u3046\u306a\u6c17\u3082\u3057\u307e\u3059\u304c <br><code>When generating a ULID within the same millisecond, we can provide some guarantees regarding sort order.<\/code> <br>\u3068\u3044\u3046\u7b87\u6240\u306e\u89e3\u91c8\u3068\u3057\u3066\u306f\u300c\uff5e\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u300d\u3068\u3044\u3046Optional\u306a\u4ed5\u69d8\u306a\u306e\u304b\u306a\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3068\u306f\u3044\u3048\u30ed\u30b0\u306a\u3069\u306b\u4f7f\u3063\u305f\u969b\u306b\u591a\u5c11\u30bd\u30fc\u30c8\u3057\u3084\u3059\u304f\u306a\u308b\u3068\u601d\u308f\u308c\u308b\u305f\u3081\u3001\u3053\u306e\u4ed5\u69d8\u3082\u4eca\u56de\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u76db\u308a\u8fbc\u307f\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3b\u306a\u5909\u66f4\u70b9\u306fBASE32\u306b\u4f7f\u3063\u3066\u3044\u308b\u6587\u5b57\u7a2e\u5909\u66f4\u3067\u3059\u3002 bas &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/posts\/443"}],"collection":[{"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=443"}],"version-history":[{"count":1,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/posts\/443\/revisions"}],"predecessor-version":[{"id":444,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=\/wp\/v2\/posts\/443\/revisions\/444"}],"wp:attachment":[{"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.b64.pw\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}