Use encode/decode

This commit is contained in:
Nicholas Dudfield
2015-10-01 06:55:23 +07:00
parent 65987a83fd
commit 8a49bec48b
2 changed files with 5 additions and 5 deletions

View File

@@ -4,12 +4,12 @@ const assert = require('assert');
const coreTypes = require('@niq/ripple-core-types');
const {binary: {bytesToHex, binaryToJSON, serializeObject}} = coreTypes;
exports.binaryToJSON = function(binary) {
exports.decode = function(binary) {
assert(typeof binary === 'string');
return binaryToJSON(binary);
};
exports.jsonToBinary = function (json) {
exports.encode = function(json) {
assert(typeof json === 'object');
return bytesToHex(serializeObject(json));
};