@trivikr-test/util-hex-encoding
Advanced tools
Comparing version 3.58.0 to 3.170.0-es2015
@@ -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 @@ } |
@@ -1,4 +0,3 @@ | ||
export declare function fromHex(encoded: string): Uint8Array; | ||
export declare function toHex(bytes: Uint8Array): string; |
{ | ||
"name": "@trivikr-test/util-hex-encoding", | ||
"version": "3.58.0", | ||
"version": "3.170.0-es2015", | ||
"description": "Converts binary buffers to and from lowercase hexadecimal encoding", | ||
@@ -9,2 +9,3 @@ "scripts": { | ||
"build:es": "tsc -p tsconfig.es.json", | ||
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", | ||
"build:types": "tsc -p tsconfig.types.json", | ||
@@ -48,3 +49,3 @@ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", | ||
"concurrently": "7.0.0", | ||
"downlevel-dts": "0.7.0", | ||
"downlevel-dts": "0.10.1", | ||
"rimraf": "3.0.2", | ||
@@ -51,0 +52,0 @@ "typedoc": "0.19.2", |
@@ -1,4 +0,1 @@ | ||
# @aws-sdk/util-hex-encoding | ||
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-hex-encoding/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-hex-encoding) | ||
[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-hex-encoding.svg)](https://www.npmjs.com/package/@aws-sdk/util-hex-encoding) | ||
Please refer [README.md](https://github.com/aws/aws-sdk-js-v3/blob/v3.170.0/packages/util-hex-encoding/README.md) for v3.170.0. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15743
2
2