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

@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.722117ce to 1.0.0-beta.84aa7305

8

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

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

var dec = input[i].charCodeAt(0);
trytes += trits_1.TRYTE_ALPHABET[dec % 27];
trytes += trits_1.TRYTE_ALPHABET[(dec - dec % 27) / 27];
trytes += _1.TRYTE_ALPHABET[dec % 27];
trytes += _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(trits_1.TRYTE_ALPHABET.indexOf(trytes[i]) + trits_1.TRYTE_ALPHABET.indexOf(trytes[i + 1]) * 27);
ascii += String.fromCharCode(_1.TRYTE_ALPHABET.indexOf(trytes[i]) + _1.TRYTE_ALPHABET.indexOf(trytes[i + 1]) * 27);
}

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

"use strict";
exports.__esModule = true;
var ava_1 = require("ava");
var src_1 = require("../src");
var errors_1 = require("../src/errors");
var src_1 = require("../src");
ava_1["default"]('asciiToTrytes()', function (t) {

@@ -7,0 +7,0 @@ var ascii = 'IOTA';

"use strict";
exports.__esModule = true;
var ava_1 = require("ava");
var src_1 = require("../src");
var errors = require("../src/errors");
var src_1 = require("../src");
var INVALID_ODD_LENGTH = errors.INVALID_ODD_LENGTH, INVALID_TRYTES = errors.INVALID_TRYTES;

@@ -7,0 +7,0 @@ ava_1["default"]('trytesToAscii()', function (t) {

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

@@ -14,3 +14,3 @@ "main": "./out/src/index.js",

"test-ci": "nyc ava",
"format": "prettier",
"lint": "tslint --project .",
"docs": "tsc && jsdoc2md --no-cache --plugin dmd-clear -t README_tpl.hbs --files './out/**/*.js' > README.md"

@@ -17,0 +17,0 @@ },

@@ -0,3 +1,3 @@

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

@@ -58,3 +58,3 @@ /**

trytes += TRYTE_ALPHABET[dec % 27]
trytes += TRYTE_ALPHABET[(dec - dec % 27) / 27]
trytes += TRYTE_ALPHABET[(dec - (dec % 27)) / 27]
}

@@ -61,0 +61,0 @@

import test from 'ava'
import { asciiToTrytes } from '../src'
import { INVALID_ASCII_CHARS } from '../src/errors'
import { asciiToTrytes } from '../src'

@@ -5,0 +5,0 @@ test('asciiToTrytes()', t => {

import test from 'ava'
import { trytesToAscii } from '../src'
import * as errors from '../src/errors'
import { trytesToAscii } from '../src'

@@ -5,0 +5,0 @@ const { INVALID_ODD_LENGTH, INVALID_TRYTES } = errors

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