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.1.0 to 0.2.0

10

./dist/index.js

@@ -17,3 +17,10 @@ 'use strict';

}
// Polyfill btoa with a pure JS implementation. This is adapted from the following:
const uint8ArrayFromHexString = (hexString) => {
const hexRegex = /^[0-9A-Fa-f]+$/;
if (!hexString || hexString.length % 2 != 0 || !hexRegex.test(hexString)) {
throw new Error(`cannot create uint8array from invalid hex string: "${hexString}"`);
}
return new Uint8Array(hexString.match(/../g).map((h) => parseInt(h, 16)));
};
// Pure JS implementation of btoa. This is adapted from the following:
// https://github.com/jsdom/abab/blob/80874ae1fe1cde2e587bb6e51b6d7c9b42ca1d34/lib/btoa.js

@@ -78,3 +85,4 @@ function btoa(s) {

exports.stringToBase64urlString = stringToBase64urlString;
exports.uint8ArrayFromHexString = uint8ArrayFromHexString;
exports.uint8ArrayToHexString = uint8ArrayToHexString;
//# sourceMappingURL=index.js.map
# @turnkey/encoding
## 0.2.0
### Minor Changes
- fac7770: Add uint8ArrayFromHexstring and drop language saying this is an internal package
## 0.1.0
Initial release

@@ -7,2 +7,3 @@ /**

export declare function uint8ArrayToHexString(input: Uint8Array): string;
export declare const uint8ArrayFromHexString: (hexString: string) => Uint8Array;
//# sourceMappingURL=index.d.ts.map

@@ -17,3 +17,10 @@ 'use strict';

}
// Polyfill btoa with a pure JS implementation. This is adapted from the following:
const uint8ArrayFromHexString = (hexString) => {
const hexRegex = /^[0-9A-Fa-f]+$/;
if (!hexString || hexString.length % 2 != 0 || !hexRegex.test(hexString)) {
throw new Error(`cannot create uint8array from invalid hex string: "${hexString}"`);
}
return new Uint8Array(hexString.match(/../g).map((h) => parseInt(h, 16)));
};
// Pure JS implementation of btoa. This is adapted from the following:
// https://github.com/jsdom/abab/blob/80874ae1fe1cde2e587bb6e51b6d7c9b42ca1d34/lib/btoa.js

@@ -78,3 +85,4 @@ function btoa(s) {

exports.stringToBase64urlString = stringToBase64urlString;
exports.uint8ArrayFromHexString = uint8ArrayFromHexString;
exports.uint8ArrayToHexString = uint8ArrayToHexString;
//# sourceMappingURL=index.js.map

4

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

@@ -16,3 +16,3 @@ "module": "./dist/index.mjs",

"license": "Apache-2.0",
"description": "Encoding utility functions (internal)",
"description": "Encoding utility functions",
"author": {

@@ -19,0 +19,0 @@ "name": "Turnkey",

# @turnkey/encoding
This is an internal package, not meant for public consumption.
Temporary workaround until we can bring this as a proper internal package. See https://github.com/lmc-eu/spirit-design-system/issues/1238 for a great outline of the problem and potential ways forward.
This is a package containing decoding and encoding functions. This is used by other Turnkey packages. Feel free to import exported functions into your own apps, but be aware that there may be significant interface changes in the future.

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