@hackthedev/dsync-sign 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/index.mjs +13 -0
- package/package.json +1 -1
- package/.gitattributes +0 -2
package/README.md
CHANGED
|
File without changes
|
package/index.mjs
CHANGED
|
@@ -52,6 +52,19 @@ export class dSyncSign {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
GenerateGid(publicKey) {
|
|
56
|
+
if (publicKey.length >= 120) {
|
|
57
|
+
return this.EncodeToBase64(publicKey.substring(80, 120)) // 40 chars
|
|
58
|
+
} else {
|
|
59
|
+
return this.EncodeToBase64(publicKey.substring(0, publicKey.length))
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
EncodeToBase64(str) {
|
|
64
|
+
return Buffer.from(str, "utf8").toString("base64")
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
55
68
|
async getPrivateKey() {
|
|
56
69
|
const {privateKey} = await this.ensureKeyPair();
|
|
57
70
|
return privateKey;
|
package/package.json
CHANGED
package/.gitattributes
DELETED