Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turnkey/encoding

Package Overview
Dependencies
Maintainers
8
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turnkey/encoding - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

13

./dist/index.js

@@ -43,2 +43,14 @@ 'use strict';

/**
* Converts a hex string to an ASCII string.
* @param {string} hexString - The input hex string to convert.
* @returns {string} - The converted ASCII string.
*/
function hexToAscii(hexString) {
let asciiStr = "";
for (let i = 0; i < hexString.length; i += 2) {
asciiStr += String.fromCharCode(parseInt(hexString.substr(i, 2), 16));
}
return asciiStr;
}
/**
* Function to normalize padding of byte array with 0's to a target length.

@@ -135,2 +147,3 @@ *

exports.hexStringToBase64url = hexStringToBase64url;
exports.hexToAscii = hexToAscii;
exports.normalizePadding = normalizePadding;

@@ -137,0 +150,0 @@ exports.stringToBase64urlString = stringToBase64urlString;

# @turnkey/encoding
## 0.4.0
### Minor Changes
- added hexToAscii function, useful for converting a raw hex string to a (wallet) mnemonic
## 0.3.0

@@ -4,0 +10,0 @@

@@ -11,2 +11,8 @@ /**

/**
* Converts a hex string to an ASCII string.
* @param {string} hexString - The input hex string to convert.
* @returns {string} - The converted ASCII string.
*/
export declare function hexToAscii(hexString: string): string;
/**
* Function to normalize padding of byte array with 0's to a target length.

@@ -13,0 +19,0 @@ *

@@ -43,2 +43,14 @@ 'use strict';

/**
* Converts a hex string to an ASCII string.
* @param {string} hexString - The input hex string to convert.
* @returns {string} - The converted ASCII string.
*/
function hexToAscii(hexString) {
let asciiStr = "";
for (let i = 0; i < hexString.length; i += 2) {
asciiStr += String.fromCharCode(parseInt(hexString.substr(i, 2), 16));
}
return asciiStr;
}
/**
* Function to normalize padding of byte array with 0's to a target length.

@@ -135,2 +147,3 @@ *

exports.hexStringToBase64url = hexStringToBase64url;
exports.hexToAscii = hexToAscii;
exports.normalizePadding = normalizePadding;

@@ -137,0 +150,0 @@ exports.stringToBase64urlString = stringToBase64urlString;

2

package.json
{
"name": "@turnkey/encoding",
"version": "0.3.0",
"version": "0.4.0",
"main": "./dist/index.js",

@@ -5,0 +5,0 @@ "module": "./dist/index.mjs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc