@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackthedev/dsync-sign",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "",
5
5
  "main": "index.mjs",
6
6
  "type": "module",
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto