@iota/converter
Advanced tools
Comparing version 1.0.0-beta.722117ce to 1.0.0-beta.84aa7305
"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
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
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
36911
29
802