Socket
Socket
Sign inDemoInstall

@iota/converter

Package Overview
Dependencies
Maintainers
5
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iota/converter - npm Package Compare versions

Comparing version 1.0.0-beta.5 to 1.0.0-beta.722117ce

.nyc_output/11ee283155b5269f16f1bd7f287677c3.json

8

out/src/ascii.js
"use strict";
exports.__esModule = true;
var errors = require("./errors");
var _1 = require("./");
var trits_1 = require("./trits");
/**

@@ -55,4 +55,4 @@ * Converts an ascii encoded string to trytes.

var dec = input[i].charCodeAt(0);
trytes += _1.TRYTE_ALPHABET[dec % 27];
trytes += _1.TRYTE_ALPHABET[(dec - dec % 27) / 27];
trytes += trits_1.TRYTE_ALPHABET[dec % 27];
trytes += trits_1.TRYTE_ALPHABET[(dec - dec % 27) / 27];
}

@@ -81,3 +81,3 @@ return trytes;

for (var i = 0; i < trytes.length; i += 2) {
ascii += String.fromCharCode(_1.TRYTE_ALPHABET.indexOf(trytes[i]) + _1.TRYTE_ALPHABET.indexOf(trytes[i + 1]) * 27);
ascii += String.fromCharCode(trits_1.TRYTE_ALPHABET.indexOf(trytes[i]) + trits_1.TRYTE_ALPHABET.indexOf(trytes[i + 1]) * 27);
}

@@ -84,0 +84,0 @@ return ascii;

@@ -92,3 +92,3 @@ "use strict";

function trytes(trits) {
if (!(trits instanceof Int8Array)) {
if (!(trits instanceof Int8Array) && !Array.isArray(trits)) {
throw new Error(errors.INVALID_TRITS);

@@ -95,0 +95,0 @@ }

{
"name": "@iota/converter",
"version": "1.0.0-beta.5",
"version": "1.0.0-beta.722117ce",
"description": "Convert values & trytes to trits and back",

@@ -5,0 +5,0 @@ "main": "./out/src/index.js",

import * as errors from './errors'
import { TRYTE_ALPHABET } from './'
import { TRYTE_ALPHABET } from './trits'

@@ -4,0 +4,0 @@ /**

@@ -96,3 +96,3 @@ import * as errors from './errors'

export function trytes(trits: Int8Array): string {
if (!(trits instanceof Int8Array)) {
if (!(trits instanceof Int8Array) && !Array.isArray(trits)) {
throw new Error(errors.INVALID_TRITS)

@@ -99,0 +99,0 @@ }

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