dimabory / ecoji-js

JavaScript port of Ecoji
https://www.npmjs.com/package/ecoji-js
Apache License 2.0
5 stars 3 forks source link

specify hex or binary encoding with encodeType and decodeType functions #10

Open biocrypto730 opened 5 years ago

biocrypto730 commented 5 years ago

One glitch is that with hex, you need there to be an even amount of letters to encode. I added a warning in the console for this.

I am not sure yet if it has a problem with the rune character yet. Please let me know if it should / shouldn't.

var ecoji = require("ecoji-js");
var input = "abcde12341234199900"
console.log("input",input,input.length,input.length % 4)
var thing = ecoji.encodeType(input,"hex");
console.log("ecoji",thing);
var newthing = ecoji.decodeType(thing,"hex");
console.log("input",newthing);
codecov-io commented 5 years ago

Codecov Report

Merging #10 into master will decrease coverage by 7.57%. The diff coverage is 44.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #10      +/-   ##
==========================================
- Coverage   98.27%   90.69%   -7.58%     
==========================================
  Files           5        5              
  Lines         116      129      +13     
  Branches       12       15       +3     
==========================================
+ Hits          114      117       +3     
- Misses          1        8       +7     
- Partials        1        4       +3
Impacted Files Coverage Δ
lib/src/Ecoji.ts 85.54% <44.44%> (-11.61%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b814930...eccd175. Read the comment docs.