Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
N
node-bigstream
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bs
node-bigstream
Commits
0f7b63d7
Commit
0f7b63d7
authored
May 18, 2020
by
Kamron Aroonrua
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fn crypto
parent
49c5fdee
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
crypto.js
plugins/dt/dt-transform/fn/crypto.js
+18
-0
dom.js
plugins/dt/dt-transform/fn/dom.js
+6
-0
package.json
plugins/dt/dt-transform/package.json
+14
-0
No files found.
plugins/dt/dt-transform/fn/crypto.js
0 → 100644
View file @
0f7b63d7
var
crypto
=
require
(
"crypto"
);
var
publicEncrypt
=
function
(
data
,
publicKey
)
{
var
buffer
=
Buffer
.
from
(
data
);
var
encrypted
=
crypto
.
publicEncrypt
(
publicKey
,
buffer
);
return
encrypted
.
toString
(
"base64"
);
};
var
privateDecrypt
=
function
(
crypted_data
,
privateKey
)
{
var
buffer
=
Buffer
.
from
(
crypted_data
,
"base64"
);
var
decrypted
=
crypto
.
privateDecrypt
(
privateKey
,
buffer
);
return
decrypted
.
toString
(
"utf8"
);
};
module
.
exports
=
{
publicEncrypt
:
publicEncrypt
,
privateDecrypt
:
privateDecrypt
}
\ No newline at end of file
plugins/dt/dt-transform/fn/dom.js
0 → 100644
View file @
0f7b63d7
var
DomParser
=
require
(
'dom-parser'
);
var
parser
=
new
DomParser
();
module
.
exports
=
function
(
html
)
{
return
parser
.
parseFromString
(
html
);
}
\ No newline at end of file
plugins/dt/dt-transform/package.json
0 → 100644
View file @
0f7b63d7
{
"name"
:
"dt-transform"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"dom-parser"
:
"^0.1.6"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment