Skip to content

Commit b70c138

Browse files
committed
Fixed README.md
1 parent 092cb76 commit b70c138

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,25 @@ console.log(new Date(makeUUID.baseClock)); // See the base-clock
115115
```ts
116116
import * as libuuid from "@litert/uuid";
117117

118-
const makeUUID = libuuid.SnowflakeSIvA.createGenerateor({
118+
const factory = UUID.SnowflakeBIvA.createFactory();
119+
120+
const makeUUID = factory.create({
119121

120122
/**
121123
* The ID of machine, 0 ~ 1023
122124
*/
123-
"mid": 333,
125+
"machineId": 333,
124126

125127
/**
126128
* Calculate the cursor of the incremental sequence insides generator by
127129
* the last generated UUID.
128130
*/
129-
"cursor": libuuid.SnowflakeSIvA.calculateCursor(1562244321456127)
131+
"cursor": factory.calculateCursor(1562244321456127)
130132
});
131133

132134
console.log(nextUUID());
133135
console.log(nextUUID());
134-
console.log(nextUUID.MACHINE_ID);
136+
console.log(nextUUID.machineId);
135137
console.log(Number.isSafeInteger(nextUUID()));
136138

137139
```

README_zh.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ console.log(new Date(makeUUID.baseClock)); // 查看 UUID 生成器的业务基
111111
```ts
112112
import * as libuuid from "@litert/uuid";
113113

114-
const makeUUID = libuuid.SnowflakeSIvA.createGenerateor({
114+
const factory = UUID.SnowflakeBIvA.createFactory();
115+
116+
const makeUUID = factory.create({
115117

116118
/**
117119
* 机器序号,取值范围:0 ~ 1023。
@@ -121,12 +123,12 @@ const makeUUID = libuuid.SnowflakeSIvA.createGenerateor({
121123
/**
122124
* 根据上一次生成的 UUID 重新计算内部递增序列指针。
123125
*/
124-
"cursor": libuuid.SnowflakeSIvA.calculateCursor(1562244321456127)
126+
"cursor": factory.calculateCursor(1562244321456127)
125127
});
126128

127129
console.log(nextUUID());
128130
console.log(nextUUID());
129-
console.log(nextUUID.MACHINE_ID);
131+
console.log(nextUUID.machineId);
130132
console.log(Number.isSafeInteger(nextUUID()));
131133

132134
```

0 commit comments

Comments
 (0)