Installations
npm install js-encoding-utils
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Node Version
20.5.1
NPM Version
9.8.0
Score
98.1
Supply Chain
93.9
Quality
76.2
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (80.64%)
JavaScript (19.36%)
Developer
junkurihara
Download Statistics
Total Downloads
3,173,196
Last Day
6,016
Last Week
28,612
Last Month
172,711
Last Year
1,197,343
GitHub Statistics
2 Stars
1,782 Commits
4 Watching
5 Branches
2 Contributors
Bundle Size
5.27 kB
Minified
1.58 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.7.3
Package Id
js-encoding-utils@0.7.3
Unpacked Size
35.43 kB
Size
7.81 kB
File Count
13
NPM Version
9.8.0
Node Version
20.5.1
Publised On
02 Sept 2023
Total Downloads
Cumulative downloads
Total Downloads
3,173,196
Last day
-2%
6,016
Compared to previous day
Last week
-33.6%
28,612
Compared to previous week
Last month
0.5%
172,711
Compared to previous month
Last year
67.9%
1,197,343
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Miscellaneous Encoding Utilities for Crypto-related Objects in JavaScript
WARNING: At this time this solution should be considered suitable for research and experimentation, further code and security review is needed before utilization in a production application.
Introduction and Overview
This library is being developed to handle cryptographic data objects, e.g., PEM-formatted X.509 certificate, in JavaScript. Note that this library provides no cryptographic functions like encryption, but provides encoders, decoders and formatters of data formats related to cryptographic data objects. In particular, this introduces Base64(Url)-ArrayBuffer en/decoder, HexString-ArrayBuffer en/decoder and PEM-Binary formatter at this point. Moreover, this library is designed to be 'universal', i.e., it works both on most browsers and on Node.js just by importing from npm/source code.
Installation
At your project directory, do either one of the following.
-
From npm/yarn:
1$ npm install --save js-encoding-utils // npm 2$ yarn add js-encoding-utils // yarn
-
From GitHub:
1$ git clone https://github.com/junkurihara/jseu.git
Then you should import the package as follows.
1import jseu from 'js-encoding-utils'; // for npm 2import jseu from 'jseu/dist/index.js'; // for github
Usage
Base64 <-> Binary
1// msg is an ArrayBuffer or Typed Array 2const encoded = jseu.encoder.encodeBase64(msg); 3// now you get Base64 string 4 5const decoded = jseu.encoder.decodeBase64(encoded); 6// now you get the original message in Uint8Array
Base64Url <-> Binary
1// msg is an ArrayBuffer or Typed Array 2const encoded = jseu.encoder.encodeBase64Url(msg); 3// now you get Base64Url string 4 5const decoded = jseu.encoder.decodeBase64Url(encoded); 6// now you get the original message in Uint8Array
HexString <-> Binary
1// msg is an ArrayBuffer or Typed Array 2const encoded = jseu.encoder.arrayBufferToHexString(msg); 3// now you get the hex-stringified message string 4 5const decoded = jseu.encoder.hexStringToArrayBuffer(encoded); 6// now you get the original message in Uint8Array
PEM <-> Binary (usually DER encoding)
1// X.509 formatted certificate 2const certPEM ='-----BEGIN CERTIFICATE-----...'; 3 4const binCert = jseu.formatter.pemToBin(certPEM); 5// now you get the DER encoded certificate in Uint8Array 6 7const pemCert = jseu.formatter.binToPem(binCert, 'certificate'); 8// now you get the original certificate.
License
Licensed under the MIT license, see LICENSE
file.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yml:72
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/junkurihara/jseu/ci.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/junkurihara/jseu/ci.yml/develop?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/junkurihara/jseu/ci.yml/develop?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:79: update your workflow using https://app.stepsecurity.io/secureworkflow/junkurihara/jseu/ci.yml/develop?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:51
- Info: 2 out of 5 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'develop'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 29 are checked with a SAST tool
Score
4.8
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More