Browse Source

auto commit

tags/v1.0.1
yitter 3 years ago
parent
commit
ac4488a66b
6 changed files with 26 additions and 3 deletions
  1. +19
    -1
      FFI for Python-Node-PHP/README.md
  2. BIN
      FFI for Python-Node-PHP/lib/yitidgen-linux-x64.7z
  3. BIN
      FFI for Python-Node-PHP/lib/yitidgen-win-x64.7z
  4. BIN
      FFI for Python-Node-PHP/lib/yitidgen.dll
  5. +5
    -1
      README.md
  6. +2
    -1
      Rust/source/src/lib.rs

+ 19
- 1
FFI for Python-Node-PHP/README.md View File

@@ -4,4 +4,22 @@

Pyton、node.js、PHP 等可以通过 FFI 方式调用动态库生成 ID。

这里将提供不同操作系统的动态库
不同操作系统请引用不同的动态库。

## 接口方法说明

第1步,**全局** 初始化(应用程序启动时执行一次):
```
// 设置参数
// workerId
// workerIdBitLength,影响 workerId最大值,一般设置6。支持的 WorkerId 最大值为2^workerIdBitLength-1
// seqBitLength,一般只要设置6.
extern "C" void SetOptions(int workerId, int workerIdBitLength, int seqBitLength)
```

第2步,生成ID:
```
// 生成ID
extern "C" long NextId()
```


BIN
FFI for Python-Node-PHP/lib/yitidgen-linux-x64.7z View File


BIN
FFI for Python-Node-PHP/lib/yitidgen-win-x64.7z View File


BIN
FFI for Python-Node-PHP/lib/yitidgen.dll View File


+ 5
- 1
README.md View File

@@ -205,11 +205,15 @@ redis作用
🌲🏳️‍🌈 C:[查看示例][5]
🌲🏳️‍🌈 Vlang:[查看示例][6]
如果你有其它语言的实现需求,不妨试着自己写一个,或者给我留言。
[1]: https://gitee.com/yitter/idgenerator/tree/master/C%23.NET
[2]: https://gitee.com/yitter/idgenerator/tree/master/Java
[3]: https://gitee.com/yitter/idgenerator/tree/master/Go
[4]: https://gitee.com/yitter/idgenerator/tree/master/Rust
[5]: https://gitee.com/yitter/idgenerator/tree/master/C
[6]: https://gitee.com/yitter/idgenerator/tree/master/ZeOthers/Vlang

+ 2
- 1
Rust/source/src/lib.rs View File

@@ -106,4 +106,5 @@ pub extern "C" fn NextId() -> i64 {
// //return 1;
// }
// cargo build --release
// build-win-x64: cargo build --release
// build-linux-x64: cargo build --target x86_64-unknown-linux-musl --release

Loading…
Cancel
Save