Socket
Socket
Sign inDemoInstall

@aws-sdk/util-hex-encoding

Package Overview
Dependencies
1
Maintainers
5
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.170.0 to 3.183.0

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03)
**Note:** Version bump only for package @aws-sdk/util-hex-encoding
# [3.170.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.169.0...v3.170.0) (2022-09-13)

@@ -8,0 +16,0 @@

22

dist-es/index.js

@@ -1,7 +0,7 @@

var SHORT_TO_HEX = {};
var HEX_TO_SHORT = {};
for (var i = 0; i < 256; i++) {
var encodedByte = i.toString(16).toLowerCase();
const SHORT_TO_HEX = {};
const HEX_TO_SHORT = {};
for (let i = 0; i < 256; i++) {
let encodedByte = i.toString(16).toLowerCase();
if (encodedByte.length === 1) {
encodedByte = "0".concat(encodedByte);
encodedByte = `0${encodedByte}`;
}

@@ -15,5 +15,5 @@ SHORT_TO_HEX[i] = encodedByte;

}
var out = new Uint8Array(encoded.length / 2);
for (var i = 0; i < encoded.length; i += 2) {
var encodedByte = encoded.slice(i, i + 2).toLowerCase();
const out = new Uint8Array(encoded.length / 2);
for (let i = 0; i < encoded.length; i += 2) {
const encodedByte = encoded.slice(i, i + 2).toLowerCase();
if (encodedByte in HEX_TO_SHORT) {

@@ -23,3 +23,3 @@ out[i / 2] = HEX_TO_SHORT[encodedByte];

else {
throw new Error("Cannot decode unrecognized sequence ".concat(encodedByte, " as hexadecimal"));
throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
}

@@ -30,4 +30,4 @@ }

export function toHex(bytes) {
var out = "";
for (var i = 0; i < bytes.byteLength; i++) {
let out = "";
for (let i = 0; i < bytes.byteLength; i++) {
out += SHORT_TO_HEX[bytes[i]];

@@ -34,0 +34,0 @@ }

export declare function fromHex(encoded: string): Uint8Array;
export declare function toHex(bytes: Uint8Array): string;
{
"name": "@aws-sdk/util-hex-encoding",
"version": "3.170.0",
"version": "3.183.0",
"description": "Converts binary buffers to and from lowercase hexadecimal encoding",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc