@iota/converter
Advanced tools
Comparing version 1.0.0-beta.11 to 1.0.0-beta.12
@@ -9,2 +9,4 @@ "use strict"; | ||
__export(require("./trits")); | ||
exports.bytesToTrits = function (bytes) { return Int8Array.from(bytes); }; | ||
exports.tritsToBytes = function (trits) { return Buffer.from(trits.buffer); }; | ||
//# sourceMappingURL=index.js.map |
@@ -58,2 +58,5 @@ "use strict"; | ||
var index = exports.TRYTE_ALPHABET.indexOf(input.charAt(i)); | ||
if (index === -1) { | ||
throw new Error(errors.INVALID_TRYTES); | ||
} | ||
result[i * 3] = exports.TRYTES_TRITS_LUT[index][0]; | ||
@@ -60,0 +63,0 @@ result[i * 3 + 1] = exports.TRYTES_TRITS_LUT[index][1]; |
{ | ||
"name": "@iota/converter", | ||
"version": "1.0.0-beta.11", | ||
"version": "1.0.0-beta.12", | ||
"description": "Convert values & trytes to trits and back", | ||
@@ -65,3 +65,4 @@ "main": "./out/src/index.js", | ||
"url": "https://github.com/iotaledger/iota.js.git/tree/develop/packages/crypto" | ||
} | ||
}, | ||
"gitHead": "0777d33f7a01a2751b570774e917ce5e2485cd40" | ||
} |
/** @module converter */ | ||
export * from './ascii' | ||
export * from './trits' | ||
export const bytesToTrits = (bytes: Buffer) => Int8Array.from(bytes) | ||
export const tritsToBytes = (trits: Int8Array) => Buffer.from(trits.buffer) |
@@ -61,2 +61,6 @@ import * as errors from './errors' | ||
if (index === -1) { | ||
throw new Error(errors.INVALID_TRYTES) | ||
} | ||
result[i * 3] = TRYTES_TRITS_LUT[index][0] | ||
@@ -63,0 +67,0 @@ result[i * 3 + 1] = TRYTES_TRITS_LUT[index][1] |
@@ -0,3 +1,6 @@ | ||
/// <reference types="node" /> | ||
/** @module converter */ | ||
export * from './ascii'; | ||
export * from './trits'; | ||
export declare const bytesToTrits: (bytes: Buffer) => Int8Array; | ||
export declare const tritsToBytes: (trits: Int8Array) => Buffer; |
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
68047
32
815