Javascript Utilities for WalletConnect
Installations
npm install @walletconnect/encoding
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
16.17.0
NPM Version
8.19.1
Score
99.4
Supply Chain
96.2
Quality
82.7
Maintenance
100
Vulnerability
100
License
Contributors
Languages
TypeScript (96.65%)
JavaScript (3.35%)
Developer
walletconnect
Download Statistics
Total Downloads
33,626,078
Last Day
16,812
Last Week
81,291
Last Month
395,057
Last Year
7,727,111
GitHub Statistics
117 Stars
413 Commits
80 Forks
24 Watching
50 Branches
31 Contributors
Bundle Size
5.96 kB
Minified
1.73 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.2
Package Id
@walletconnect/encoding@1.0.2
Unpacked Size
287.01 kB
Size
38.23 kB
File Count
14
NPM Version
8.19.1
Node Version
16.17.0
Total Downloads
Cumulative downloads
Total Downloads
33,626,078
Last day
-10.4%
16,812
Compared to previous day
Last week
-17.3%
81,291
Compared to previous week
Last month
-10.7%
395,057
Compared to previous month
Last year
-44.5%
7,727,111
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Dev Dependencies
6
@walletconnect/encoding
Byte encoding utils
API
1// -- Buffer --------------------------------------------- // 2 3function bufferToUtf8(buf: Buffer): string; 4function bufferToHex(buf: Buffer, prefixed?: boolean): string; 5function bufferToArray(buf: Buffer): Uint8Array; 6function bufferToNumber(buf: Buffer): number; 7function bufferToBinary(buf: Buffer): string; 8 9// -- Utf8 ----------------------------------------------- // 10 11function utf8ToBuffer(utf8: string): Buffer; 12function utf8ToHex(utf8: string, prefixed?: boolean): string; 13function utf8ToArray(utf8: string): Uint8Array; 14function utf8ToNumber(utf8: string): number; 15function utf8ToBinary(utf8: string): string; 16 17// -- Hex ------------------------------------------------ // 18 19function hexToBuffer(hex: string): Buffer; 20function hexToUtf8(hex: string): string; 21function hexToArray(hex: string): Uint8Array; 22function hexToNumber(hex: string): number; 23function hexToBinary(hex: string): string; 24 25// -- Uint8Array ----------------------------------------- // 26 27function arrayToBuffer(arr: Uint8Array): Buffer; 28function arrayToUtf8(arr: Uint8Array): string; 29function arrayToHex(arr: Uint8Array, prefixed?: boolean): string; 30function arrayToNumber(arr: Uint8Array): number; 31function arrayToBinary(arr: Uint8Array): string; 32 33// -- Number ---------------------------------------- // 34 35function numberToBuffer(num: number): Buffer; 36function numberToUtf8(num: number): string; 37function numberToHex(num: number, prefixed?: boolean): string; 38function numberToArray(num: number): Uint8Array; 39function numberToBinary(num: number): string; 40 41// -- Binary ----------------------------------------------- // 42 43function binaryToBuffer(bin: string): Buffer; 44function binaryToArray(bin: string): Uint8Array; 45function binaryToHex(bin: string | string, prefixed?: boolean): string; 46function binaryToUtf8(bin: string): string; 47function binaryToNumber(bin: string): number; 48 49// -- Validators ----------------------------------------- // 50 51function isBinaryString(str: any): boolean; 52function isHexString(str: any, length?: number): boolean; 53function isBuffer(val: any): boolean; 54function isTypedArray(val: any): boolean; 55function isArrayBuffer(val: any): boolean; 56 57function getType(val: any); 58function getEncoding(str: string); 59 60// -- Misc ----------------------------------------------- // 61 62function concatBuffers(...args: Buffer[]): Buffer; 63function concatArrays(...args: Uint8Array[]): Uint8Array; 64function trimLeft(data: Buffer, length: number): Buffer; 65function trimRight(data: Buffer, length: number): Buffer; 66 67function calcByteLength(length: number, byteSize: number): number; 68function splitBytes(str: string, byteSize: number): string[]; 69function sanitizeBytes(str: string, byteSize: number, padding: string): string; 70function swapBytes(str: string): string; 71function swapHex(str: string): string; 72 73function padLeft(str: string, length: number, padding?: string): string; 74function padRight(str: string, length: number, padding?: string): string; 75 76function removeHexPrefix(hex: string): string; 77function addHexPrefix(hex: string): string; 78function sanitizeHex(hex: string): string; 79function removeHexLeadingZeros(hex: string): string;
No vulnerabilities found.
Reason
30 commit(s) out of 30 and 0 issue activity out of 5 found in the last 90 days -- score normalized to 10
Reason
no vulnerabilities detected
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: : LICENSE:1
Reason
no binaries found in the repo
Reason
dependency not pinned by hash detected -- score normalized to 9
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/WalletConnect/walletconnect-utils/build.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/WalletConnect/walletconnect-utils/build.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/build.yml:31
- Info: Third-party GitHubActions are pinned
- Info: Dockerfile dependencies are pinned
- Info: no insecure (not pinned by hash) dependency downloads found in Dockerfiles
- Info: no insecure (not pinned by hash) dependency downloads found in shell scripts
Reason
GitHub code reviews found for 15 commits out of the last 30 -- score normalized to 5
Details
- Warn: no reviews found for commit: f2a331f63ab133c48c93a19baf44a43b73e6b9fc
- Warn: no reviews found for commit: d33e8f4e9625a8d393239750aebbf9c653bf5d53
- Warn: no reviews found for commit: c19b1fe1bca195fe7b97a9edd4a8dcb38168beae
- Warn: no reviews found for commit: 9de54a0e77b26ed44b935156f541cca09de3efc6
- Warn: no reviews found for commit: 51fa5b12a5d5a6a3279867a36a9d6d0819901926
- Warn: no reviews found for commit: 3c22a2ffc22f3681d621e525c389ba3464b65d58
- Warn: no reviews found for commit: 717386056b0e3858c17a006d7c769289f58dbb1c
- Warn: no reviews found for commit: dd038caa98c2c343b8da4a8d2e83aa42017f6153
- Warn: no reviews found for commit: 3b442a4148aecd18a0a58507b3e77b7882061261
- Warn: no reviews found for commit: 0c8ea0202298732832b20e76709dc8b9fbaffddc
- Warn: no reviews found for commit: 91daec9ff08f696e2a16f89098136e6872486664
- Warn: no reviews found for commit: 79392228693ab9d3b4f261a304f7a339826cc087
- Warn: no reviews found for commit: 19092bfa1bf844dd915add6bc4d252808ddc02f2
- Warn: no reviews found for commit: b51e25c1769d97ecb8a843a1644a21f3d45a9f28
- Warn: no reviews found for commit: 6cb4da714c50739255984dd052363113aca7f2cd
Reason
no badge detected
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
non read-only tokens detected in GitHub workflows
Details
- Warn: no topLevel permission defined: .github/workflows/build.yml:1: update your workflow using https://app.stepsecurity.io/secureworkflow/WalletConnect/walletconnect-utils/build.yml/master?enable=permissions
Reason
no update tool detected
Details
- Warn: dependabot config file not detected in source location. We recommend setting this configuration in code so it can be easily verified by others.
- Warn: renovatebot config file not detected in source location. We recommend setting this configuration in code so it can be easily verified by others.
Reason
security policy file not detected
Reason
project is not fuzzed
Score
5.2
/10
Last Scanned on 2022-08-15
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