this.me 2.7.7 → 2.7.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.
Files changed (64) hide show
  1. package/README.md +82 -58
  2. package/docs/Me.html +697 -0
  3. package/docs/README.md +92 -0
  4. package/docs/ThisMe.html +690 -0
  5. package/docs/cli_main.js.html +341 -0
  6. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  7. package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
  8. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  9. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  10. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  11. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  12. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  13. package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
  14. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  15. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  16. package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
  17. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  18. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  19. package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  20. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  21. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  22. package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
  23. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  24. package/docs/global.html +454 -0
  25. package/docs/index.html +258 -0
  26. package/docs/me.js.html +211 -0
  27. package/docs/module-CLI.html +963 -0
  28. package/docs/neurons_logo.png +0 -0
  29. package/docs/scripts/app.min.js +1 -0
  30. package/docs/scripts/linenumber.js +26 -0
  31. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  32. package/docs/scripts/prettify/lang-css.js +2 -0
  33. package/docs/scripts/prettify/prettify.js +28 -0
  34. package/docs/scripts/search.js +39 -0
  35. package/docs/styles/app.min.css +1 -0
  36. package/docs/styles/iframe.css +13 -0
  37. package/docs/styles/jsdoc-default.css +358 -0
  38. package/docs/styles/prettify-jsdoc.css +111 -0
  39. package/docs/styles/prettify-tomorrow.css +132 -0
  40. package/docs/styles/reset.css +44 -0
  41. package/jsdoc.json +43 -0
  42. package/package.json +20 -29
  43. package/src/cli/main.js +177 -0
  44. package/src/env.js +8 -0
  45. package/{me.html → src/me.html} +1 -0
  46. package/src/me.js +47 -0
  47. package/src/os/unix/install_me.sh +5 -0
  48. package/src/this/video.js +0 -0
  49. package/Me.js +0 -71
  50. package/crypto/crypto-browser.js +0 -20
  51. package/crypto/crypto-node.js +0 -16
  52. package/crypto/hash/hashWorker.js +0 -11
  53. package/crypto/hash/hashing.js +0 -43
  54. package/demo.js +0 -12
  55. package/main.js +0 -77
  56. package/me2.js +0 -57
  57. package/src/errorHandler.js +0 -9
  58. package/test.js +0 -36
  59. package/testHashIt.js +0 -3
  60. package/webpack.config.js +0 -18
  61. /package/{this/dir.js → index.js} +0 -0
  62. /package/{this/file.js → src/this/dir.js} +0 -0
  63. /package/{this/url.js → src/this/file.js} +0 -0
  64. /package/{this/video.js → src/this/url.js} +0 -0
package/package.json CHANGED
@@ -1,44 +1,35 @@
1
1
  {
2
2
  "name": "this.me",
3
- "version": "2.7.7",
4
- "description": "This.me should This.be",
3
+ "version": "2.7.9",
4
+ "description": "User-Centric OS.",
5
5
  "bin": {
6
- ".me": "./main.js"
6
+ ".me": "./src/cli/main.js"
7
7
  },
8
- "main": "main.js",
8
+ "type": "module",
9
+ "main": "index.js",
9
10
  "scripts": {
10
- "start": "node main.js",
11
+ "start": "node index.js",
11
12
  "test": "test"
12
13
  },
14
+ "build": "browserify src/me.js -s Me -o dist/me.bundle.js",
15
+ "keywords": [
16
+ "this.me",
17
+ "user"
18
+ ],
19
+ "devDependencies": {
20
+ "browserify": "^17.0.0"
21
+ },
13
22
  "repository": {
14
23
  "type": "git",
15
24
  "url": "git+https://github.com/suiGn/this.me.git"
16
25
  },
17
- "keywords": [
18
- "me",
19
- "DeepLearning",
20
- "neuralnetworks",
21
- "uthopias"
22
- ],
26
+ "homepage": "https://www.npmjs.com/package/this.me",
27
+ "docs": "https://suiGn.github.io/this.me",
23
28
  "author": "suiGn",
24
29
  "license": "MIT",
30
+ "repoType": "NPM Package",
25
31
  "dependencies": {
26
- "be.this": "^1.1.6",
27
- "cleaker": "^2.3.4",
28
- "fs": "^0.0.1-security",
29
- "i.mlearning": "^2.2.0",
30
- "netget": "^2.2.3",
31
- "neurons.me": "^2.7.1",
32
- "this.atom":"^1.3.2",
33
- "this.audio": "^1.0.6",
34
- "this.be": "^2.1.6",
35
- "this.dom": "^1.0.4",
36
- "this.pixel": "^3.3.6",
37
- "this.wallet":"^1.0.2",
38
- "this.pixelgrid": "^3.3.2",
39
- "this.text": "^1.0.5",
40
- "this.video":"^1.0.0",
41
- "v.path": "^2.2.0"
42
- },
43
- "homepage": "https://github.com/suiGn/this.me#readme"
32
+ "commander": "^11.1.0",
33
+ "inquirer": "^9.2.12"
34
+ }
44
35
  }
@@ -0,0 +1,177 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @module CLI
4
+ * @description Command Line Interface Functionalities for .me
5
+ * Author: SuiGn
6
+ */
7
+
8
+ import os from 'os';
9
+ import Me from '../me.js';
10
+ import { Command } from 'commander';
11
+ const program = new Command();
12
+ import inquirer from 'inquirer';
13
+ import fs from 'fs';
14
+ import path from 'path';
15
+ import crypto from 'crypto';
16
+
17
+ program
18
+ .command('user <username> <pin>')
19
+ .description('Authenticate and start a session for a given user')
20
+ .action((username, pin) => {
21
+ console.log(`Attempting to authenticate user: ${username}`);
22
+ // Authentication logic here
23
+ });
24
+
25
+ program
26
+ .option('-o, --options', 'View options and commands');
27
+
28
+ /**
29
+ * Display a welcome message to the user.
30
+ */
31
+ function welcomeToMe() {
32
+ console.log(`
33
+ ___________
34
+ [------------]
35
+ | .--------. |
36
+ | |01010101| | __________
37
+ | |11010101| | /__________\
38
+ [--------| -------- |------| --*-- |-------]
39
+ | [----_-.-----] |o ====== | |
40
+ | ______|_|_______ |__________| |
41
+ | / %%%%%%%%%%%% \ |
42
+ | / %%%%%%%%%%%%%% \ |
43
+ | ^^^^^^^^^^^^^^^^^^^^ |
44
+ [---------------------------------.me-----------]
45
+ -^^^^^^^^...
46
+ Welcome to .me.
47
+ `);
48
+ console.log(`Host_Session@ ${os.userInfo().username}`);
49
+ console.log(`v.path@ ${os.homedir()}/this.me`);
50
+ }
51
+
52
+ /**
53
+ * Prompts the user to select an action and returns their choice.
54
+ * @returns {Promise<string>} The user's choice.
55
+ */
56
+ async function getUserChoice() {
57
+ const choices = ['View Existing Profiles', 'Create New Profile', 'Exit'];
58
+ const answer = await inquirer.prompt([{
59
+ type: 'list',
60
+ name: 'action',
61
+ message: 'What would you like to do?',
62
+ choices: choices
63
+ }]);
64
+ return answer.action;
65
+ }
66
+
67
+ /**
68
+ * Prompts the user for details to create a new profile.
69
+ * @returns {Promise<Me>} The new Me object with user details.
70
+ */
71
+ async function getNewProfileDetails() {
72
+ const questions = [
73
+ {
74
+ type: 'input',
75
+ name: 'name',
76
+ message: 'What is your first name?',
77
+ // Add validation as needed
78
+ },
79
+ {
80
+ type: 'input',
81
+ name: 'lastname',
82
+ message: 'What is your last name?',
83
+ // Add validation as needed
84
+ },
85
+ {
86
+ type: 'input',
87
+ name: 'birthday',
88
+ message: 'What is your birthday? (YYYY-MM-DD)',
89
+ // Add validation as needed
90
+ },
91
+ {
92
+ type: 'password',
93
+ name: 'password',
94
+ message: 'Choose a password:',
95
+ // Add validation as needed
96
+ },
97
+ {
98
+ type: 'input',
99
+ name: 'pin',
100
+ message: 'Choose a PIN:',
101
+ // Add validation as needed
102
+ },
103
+ // ... Add more questions as needed
104
+ ];
105
+ const userDetails = await inquirer.prompt(questions);
106
+ return new Me(
107
+ userDetails.name,
108
+ userDetails.lastname,
109
+ userDetails.birthday,
110
+ userDetails.password,
111
+ userDetails.pin
112
+ );
113
+ }
114
+
115
+ /**
116
+ * Writes the .me object to the filesystem.
117
+ * @param {Me} meObject - The Me object to be saved.
118
+ */
119
+ function writeMeObjectToFile(meObject) {
120
+ const meDirectory = path.join(os.homedir(), '.thisme');
121
+ if (!fs.existsSync(meDirectory)) {
122
+ fs.mkdirSync(meDirectory, { recursive: true });
123
+ }
124
+
125
+ const filePath = path.join(meDirectory, `${meObject.name}.me`);
126
+ // Consider encrypting the data here before writing to the filesystem
127
+ fs.writeFileSync(filePath, JSON.stringify(meObject.getIdentityObject()));
128
+ console.log('Profile created successfully.');
129
+ }
130
+
131
+ /**
132
+ * Function to display options and commands.
133
+ */
134
+ function displayOptionsAndCommands() {
135
+ console.log(program.helpInformation());
136
+ }
137
+
138
+ /**
139
+ * Main function to handle the CLI interactions.
140
+ * Continuously prompts the user for actions until an exit command is given.
141
+ */
142
+ async function main() {
143
+ welcomeToMe();
144
+ let exit = false;
145
+ while (!exit) {
146
+ const choice = await getUserChoice();
147
+ switch (choice) {
148
+ case 'View Existing Profiles':
149
+ console.log('Existing profiles will be displayed here.');
150
+ break;
151
+ case 'Create New Profile':
152
+ const meObject = await getNewProfileDetails();
153
+ writeMeObjectToFile(meObject);
154
+ break;
155
+ case 'Exit':
156
+ console.log('Exiting .me CLI.');
157
+ exit = true;
158
+ break;
159
+ default:
160
+ console.log('Invalid choice. Please try again.');
161
+ }
162
+ }
163
+ }
164
+
165
+ if (process.argv.length > 2) {
166
+ program.parse(process.argv);
167
+ } else {
168
+ main();
169
+ }
170
+
171
+ // Error handling for CLI
172
+ process.on('uncaughtException', (err) => {
173
+ console.error('An error occurred in the CLI:', err.message);
174
+ process.exit(1);
175
+ });
176
+
177
+
package/src/env.js ADDED
@@ -0,0 +1,8 @@
1
+ // env.js
2
+ // Detect if running in Node.js or Browser
3
+ let isNodeEnvironment = (typeof process !== 'undefined' && process.versions && process.versions.node);
4
+ if (isNodeEnvironment) {
5
+ module.exports = require('./me-node');
6
+ } else {
7
+ module.exports = require('./me-browser');
8
+ }
@@ -4,6 +4,7 @@
4
4
  </head>
5
5
  <body>
6
6
  Hello, me!
7
+
7
8
  <script>
8
9
  window.fbAsyncInit = function() {
9
10
  FB.init({
package/src/me.js ADDED
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Represents a user identity in the this.me system.
3
+ */
4
+ class Me {
5
+ /**
6
+ * Create a ThisMe instance.
7
+ * @param {string} name - The first name of the user.
8
+ * @param {string} lastname - The last name of the user.
9
+ * @param {string} birthday - The birthday of the user in YYYY-MM-DD format.
10
+ * @param {string} password - The password chosen by the user.
11
+ * @param {string} pin - The personal identification number chosen by the user.
12
+ */
13
+ constructor(name, lastname, birthday, password, pin) {
14
+ this.name = name;
15
+ this.lastname = lastname;
16
+ this.birthday = birthday;
17
+ this.password = password;
18
+ this.pin = pin;
19
+ }
20
+
21
+ /**
22
+ * Validates the user data. Throws an error if any field is empty.
23
+ * @throws Will throw an error if a required field is missing.
24
+ */
25
+ validateData() {
26
+ if (!this.name || !this.lastname || !this.birthday || !this.password || !this.pin) {
27
+ throw new Error("All fields must be filled");
28
+ }
29
+ // Further validation rules can be added here
30
+ }
31
+
32
+ /**
33
+ * Prepares and returns the identity object for hashing.
34
+ * @returns {Object} The identity object with user data.
35
+ */
36
+ getIdentityObject() {
37
+ this.validateData();
38
+ return {
39
+ name: this.name,
40
+ lastname: this.lastname,
41
+ birthday: this.birthday,
42
+ credentials: `${this.password}:${this.pin}` // Combining password and pin
43
+ };
44
+ }
45
+ }
46
+
47
+ export default Me;
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ # Copy files, install dependencies, etc.
3
+ # Add me.local to /etc/hosts
4
+ echo "127.0.0.1 me.local" >> /etc/hosts
5
+ # Start the server (or provide instructions on how to do so)
File without changes
package/Me.js DELETED
@@ -1,71 +0,0 @@
1
- //Me.js
2
- let cryptoModule;
3
- if (typeof window !== 'undefined' && typeof window.crypto !== 'undefined') {
4
- cryptoModule = require('./crypto/crypto-browser');
5
- } else {
6
- cryptoModule = require('./crypto/crypto-node');
7
- }
8
-
9
- class Me {
10
- constructor(name, email, birthDate, location = {}, preferences = {}) {
11
- this.name = name;
12
- this.email = email;
13
- this.birthDate = birthDate;
14
- this.location = location;
15
- this.preferences = preferences;
16
- // Social Media Accounts
17
- this.socialMedia = {
18
- facebook: {
19
- appId: 'YOUR_FACEBOOK_APP_ID', // Replace with your actual Facebook App ID
20
- token: null
21
- }
22
- // ... You can add more platforms here
23
- };
24
- // Generate key pair upon instantiation
25
- this.keyPair = cryptoModule.generateKeyPair();
26
- }
27
-
28
- connectFacebook(token) {
29
- this.socialMedia.facebook.token = token;
30
- // You can expand this function to do more, like fetch the user's profile data using the token.
31
- }
32
-
33
- getFacebookToken() {
34
- return this.socialMedia.facebook.token;
35
- }
36
-
37
- // the public key can be shared for verification
38
- getPublicKey() {
39
- return this.keyPair.publicKey;
40
- }
41
- // Use the private key for signing data.
42
- signData(data) {
43
- try {
44
- const sign = cryptoModule.createSign('SHA256');
45
- sign.update(data);
46
- sign.end();
47
- return sign.sign(this.keyPair.privateKey);
48
- } catch (err) {
49
- console.error("Error during signing data: ", err);
50
- return null;
51
- }
52
- }
53
-
54
- verifySignature(data, signature) {
55
- try {
56
- const verify = cryptoModule.createVerify('SHA256');
57
- verify.update(data);
58
- verify.end();
59
- return verify.verify(this.keyPair.publicKey, signature);
60
- } catch (err) {
61
- console.error("Error during verifying signature: ", err);
62
- return false;
63
- }
64
- }
65
-
66
- updateLocation(newLocation) {
67
- this.location = newLocation;
68
- }
69
- }
70
-
71
- module.exports = Me;
@@ -1,20 +0,0 @@
1
- // crypto-browser.js
2
- async function generateKeyPair() {
3
- const keyPair = await window.crypto.subtle.generateKey(
4
- {
5
- name: "RSASSA-PKCS1-v1_5",
6
- modulusLength: 2048,
7
- publicExponent: new Uint8Array([1, 0, 1]),
8
- hash: "SHA-256"
9
- },
10
- true,
11
- ["sign", "verify"]
12
- );
13
- return keyPair;
14
- }
15
- // ... other cryptographic operations using the Web Cryptography API ...
16
- module.exports = {
17
- generateKeyPair,
18
- // ... export other cryptographic functions ...
19
- };
20
-
@@ -1,16 +0,0 @@
1
- // crypto-node.js
2
- const crypto = require('crypto');
3
- function generateKeyPair() {
4
- const { privateKey, publicKey } = crypto.generateKeyPairSync('rsa', {
5
- modulusLength: 2048,
6
- });
7
- return {
8
- privateKey: privateKey.export({ type: 'pkcs1', format: 'pem' }),
9
- publicKey: publicKey.export({ type: 'pkcs1', format: 'pem' }),
10
- };
11
- }
12
- // ... other cryptographic operations using Node's crypto module ...
13
- module.exports = {
14
- generateKeyPair,
15
- // ... export other cryptographic functions ...
16
- };
@@ -1,11 +0,0 @@
1
- const { getAllFiles, hashThis } = require('./path-to-your-main-file');
2
-
3
- process.on('message', (directory) => {
4
- try {
5
- const files = getAllFiles(directory);
6
- const hash = hashThis(files);
7
- process.send({ success: true, hash });
8
- } catch (error) {
9
- process.send({ success: false, error: error.message });
10
- }
11
- });
@@ -1,43 +0,0 @@
1
- //hashing.js
2
- //.. THIS SECTION IS FOR HASHING PURPOSES ...//
3
- /* Create a function that computes the hash of the @src directory.
4
- 'hash-src') to handle hashing when the relevant command is passed to the script.*/
5
- const fs = require('fs');
6
- const path = require('path');
7
- const crypto = require('crypto');
8
-
9
- function getAllFiles(directory) {
10
- const stack = [directory];
11
- const visited = new Set();
12
- const filesList = [];
13
- while (stack.length) {
14
- const currentDir = stack.pop();
15
- if (visited.has(currentDir)) continue;
16
- visited.add(currentDir);
17
- const contents = fs.readdirSync(currentDir, { withFileTypes: true });
18
- for (const item of contents) {
19
- const fullPath = path.join(currentDir, item.name);
20
- if (item.isDirectory()) {
21
- stack.push(fullPath);
22
- } else if (item.isFile()) {
23
- filesList.push(fullPath);
24
- }
25
- }
26
- }
27
- return filesList;
28
- }
29
-
30
- function hashThis(directory) {
31
- const files = getAllFiles(directory);
32
- const hash = crypto.createHash('sha256');
33
- for (const file of files) {
34
- const fileData = fs.readFileSync(file);
35
- hash.update(fileData);
36
- }
37
- return hash.digest('hex');
38
- }
39
-
40
- module.exports = {
41
- getAllFiles,
42
- hashThis
43
- };
package/demo.js DELETED
@@ -1,12 +0,0 @@
1
- const Me = require('./me2.js');
2
- // Create a new Me instance
3
- const suign = new Me('Suign Name', 'suign@email.com', '01/01/1990', { city: 'SampleCity', country: 'SampleCountry' }, { theme: 'dark', notifications: true });
4
- // Print out the public key (for demonstration purposes)
5
- console.log("Suign's Public Key:", suign.getPublicKey());
6
- // Example: Sign some data
7
- const dataToSign = "Hello, World!";
8
- const signature = suign.signData(dataToSign);
9
- console.log("Signature for 'Hello, World!':", signature.toString('base64')); // Base64 encoding just to make the signature more readable in console.
10
- // Example: Verify the signature
11
- const isValidSignature = suign.verifySignature(dataToSign, signature);
12
- console.log("Is the signature valid?", isValidSignature);
package/main.js DELETED
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env node
2
- //main.js
3
- const { exec } = require("child_process");
4
- const path = require("path");
5
- const crypto = require('crypto');
6
- const fs = require('fs');
7
- const args = process.argv.slice(2);
8
- //User Context.
9
- const os = require('os');
10
- const Me = require('./Me');
11
- const me = new Me(
12
- 'Me',
13
- 'enter your email.',
14
- 'replaceDateOfBirth',
15
- { city: 'replaceCity',
16
- country: 'replaceCountry' },
17
- { theme: 'dark' }
18
- );
19
- //CLI LOGIC
20
- function displayWelcomeMessage() {
21
- console.log(`
22
- ___________
23
- [------------]
24
- | .--------. |
25
- | |01010101| | __________
26
- | |11010101| | /__________\
27
- [--------| -------- |------| --*-- |-------]
28
- | [----_-.-----] |o ====== | |
29
- | ______|_|_______ |__________| |
30
- | / %%%%%%%%%%%% \ |
31
- | / %%%%%%%%%%%%%% \ |
32
- | ^^^^^^^^^^^^^^^^^^^^ |
33
- [---------------------------------.me-----------]
34
- -^^^^^^^^zzzz...
35
- Welcome to .me.
36
- `);
37
- console.log(`Host_Session@ ${os.userInfo().username}`);
38
- console.log(`v.path@ ${os.homedir()}`);
39
- };
40
- //.. THIS SECTION IS FOR HASHING PURPOSES ...//
41
- /* Create a function that computes the hash of the @src directory.
42
- 'hashSrc') to handle hashing when the relevant command is passed to the script.*/
43
- const { fork } = require('child_process');
44
- const { getAllFiles, hashThis } = require('./crypto/hash/hashing');
45
- function hashSrc() {
46
- try {
47
- // Adjust this to the exact location of your @src directory
48
- const srcDirPath = path.resolve(__dirname, '@me');
49
- const hash = hashThis(srcDirPath);
50
- console.log(`Hash of @src directory: ${hash}`);
51
- } catch (error) {
52
- console.error('Error hashing @src directory:', error.message);
53
- }
54
- }
55
- // COMMAND HANDLERS
56
- switch(args[0]) {
57
- case 'hash-src':
58
- hashSrc();
59
- break;
60
- case 'viewer':
61
- handleViewerCommand();
62
- break;
63
- case 'atom':
64
- console.log("Atom");
65
- break;
66
- default:
67
- // Here you can define what you'd like to happen when no arguments are passed.
68
- displayWelcomeMessage();
69
- // And any other functionality you'd like to execute
70
- break;
71
- }
72
-
73
- module.exports = {
74
- getAllFiles,
75
- hashThis,
76
- hashSrc
77
- };
package/me2.js DELETED
@@ -1,57 +0,0 @@
1
- //me.js
2
- const crypto = require('crypto');
3
- class Me {
4
- constructor(name, email, birthDate, location = {}, preferences = {}) {
5
- this.name = name;
6
- this.email = email;
7
- this.birthDate = birthDate;
8
- this.location = location;
9
- this.preferences = preferences;
10
- // Generate key pair upon instantiation
11
- this.keyPair = this.generateKeyPair();
12
- }
13
- generateKeyPair() {
14
- const { privateKey, publicKey } = crypto.generateKeyPairSync('rsa', {
15
- modulusLength: 2048,
16
- });
17
- return {
18
- privateKey: privateKey.export({ type: 'pkcs1', format: 'pem' }),
19
- publicKey: publicKey.export({ type: 'pkcs1', format: 'pem' }),
20
- };
21
- }
22
- getPublicKey() {
23
- return this.keyPair.publicKey;
24
- }
25
- // Use the private key for signing data, and the public key can be shared for verification
26
- signData(data) {
27
- const sign = crypto.createSign('SHA256');
28
- sign.update(data);
29
- sign.end();
30
- return sign.sign(this.keyPair.privateKey);
31
- }
32
- verifySignature(data, signature) {
33
- const verify = crypto.createVerify('SHA256');
34
- verify.update(data);
35
- verify.end();
36
- return verify.verify(this.keyPair.publicKey, signature);
37
- }
38
- updateLocation(newLocation) {
39
- this.location = newLocation;
40
- }
41
- }
42
- module.exports = Me;
43
-
44
-
45
-
46
- /*
47
- Face Recognition:
48
- async recognizeFace(imageData): This method would use an API or library to recognize the user's face. This can be useful for biometric-based authentication.
49
- Connect Social Media:
50
-
51
- connectSocialMedia(platform, credentials): This method would handle integration with various social media platforms. The platform parameter would specify which platform (e.g., "Facebook", "Twitter", "LinkedIn"), and the credentials would contain the necessary authentication details.
52
- Password Management:
53
-
54
- addPassword(website, password): Store a password for a particular website.
55
- getPassword(website): Retrieve the stored password for a specific website.
56
- generateStrongPassword(): Generate a random, strong password based on certain criteria.
57
- */
@@ -1,9 +0,0 @@
1
- const logError = (error) => {
2
- console.error('An error occurred:', error.message);
3
- process.exit(1);
4
- };
5
-
6
- module.exports = {
7
- logError,
8
- };
9
-
package/test.js DELETED
@@ -1,36 +0,0 @@
1
- const neurons = require('neurons.me');
2
- //cleaking
3
- const Cleaker = require('cleaker');
4
- let cleaked = new Cleaker();
5
- console.log('printing cleaked');
6
- console.log(cleaked);
7
- //cleaked completed
8
- console.log('printing neurons.me module functionality');
9
- console.log(neurons);
10
-
11
- console.log('Creating a new neuron with neurons.createNeuron()');
12
- let neuron = neurons.createNeuron();
13
- console.log(neuron);
14
-
15
- // Custom options for the neuron
16
- let options = {
17
- name: 'x', // Custom name for the neuron
18
- color: 'rgb', // Custom color
19
- activationFunction: x => x * 2 // Custom activation function
20
- };
21
- // Create a neuron with custom options
22
- let neuron2 = new neurons.createNeuron({ options: options });
23
- console.log(neuron2);
24
- // Create Layer
25
- console.log('creating layer');
26
- let layer = new neurons.Layer();
27
- console.log('printing layer');
28
- console.log(layer);
29
- //adding neurons to layer
30
- layer.addNeurons(neuron, neuron2);
31
- console.log('printing layer.neurons');
32
- console.log(layer.neurons);
33
- console.log('printing layer.map');
34
- console.log(layer.map);
35
-
36
-
package/testHashIt.js DELETED
@@ -1,3 +0,0 @@
1
- const { hashThis } = require('./main.js');
2
- const hashValueForFile = hashThis('/');
3
- console.log(`Hash value for the file: ${hashValueForFile}`);