/tualo-datamatrix

Primary LanguageJavaScriptMIT LicenseMIT

Description

tualo-datamatrix is a small and simple datamatrix library written in javascript. This library creates simple text representation of the datamatrix for the given string.

Requirements

Installation

npm install tualo-datamatrix

How to Use

From nodejs:

var Datamatrix = require('tualo-datamatrix').Datamatrix;
var dm = new Datamatrix();
var ascii = dm.getDigit('http://tualo.de',{rectangular:false,addFNC1:false});
console.log(ascii.toString());
var ascii2 = dm.getDigit('http://tualo.de',{rectangular:false,addFNC1:true});
console.log(ascii2.toString());
var ascii3 = dm.getDigit('http://tualo.de',{
	rectangular:false,
	addFNC1:false,
	length:144 // Datamatric size 44x44
});
console.log(ascii3.toString());

In a Browser:

<script src="lib/datamatrix.js" type="text/javascript"></script>
<script type="text/javascript">
    var dm = new Datamatrix();
    var ascii = dm.getDigit('http://tualo.de',{rectangular:false,addFNC1:false});
    console.log(ascii.toString());
    var ascii2 = dm.getDigit('http://tualo.de',{rectangular:false,addFNC1:true});
    console.log(ascii2.toString());
    
    var ascii3 = dm.getDigit('http://tualo.de',{
      rectangular:false,
      addFNC1:false,
      length:144 // DataMatrix 44x44
    });
    console.log(ascii3.toString());
</script>

The output will be with addFNC1 = false:

00000000000000000000
01010101010101010100
01011011100010110010
01110000011011011000
01101111011110000110
01100011110100011000
01111001000000010010
01000010100101000000
01100110101110011110
01001001110000001000
01010100100010111110
01110011101111110100
01110011100101110110
01010111001000011100
01100000111001001010
01101001010111010000
01000111101101101110
01001100110110001000
01111111111111111110
00000000000000000000

The output will be with addFNC1 = true:

00000000000000000000
01010101010101010100
01011011100111110010
01101011011100110100
01001110010001001110
01100001101101101000
01011101101000000010
01001110000001100000
01100101001100110110
01001101010001010000
01011100110101100110
01110111011100010100
01101101110101110010
01011100010111001100
01001010100001010010
01110000001011001000
01100100010000111010
01011100111010101100
01111111111111111110
00000000000000000000

The output will be with addFNC1 = false and length = 144:

0000000000000000000000000000000000000000000000
0101010101010101010101010101010101010101010100
0101101110001011000100110001011111011110000110
0111000001101101100110010000000001100111010000
0110111101111000110100111110001000011011000110
0110001111010001000101011110110110000000101000
0111100100000000011110110001001110111111000010
0100001010010110101101010100010011011001111000
0110011010111010100101111001100000000110111110
0100100101000101110011011110110110111110111000
0101010110001101001110110001100101000000001010
0111001010000010101000011001000111100100110100
0111000101000111011011110011011111010101010110
0101100110100001001110010010110100111001001100
0110111100001010111110110101101011010000001010
0111110101000111110110010100010010010100001000
0110000011000000000110111011010101101100101110
0110111001111000011011011110110010001011110100
0110011111100101000011110000101011101100101110
0110011110001101011010011001110110011111111100
0110001011011111100000111100110000001100110010
0110110011001011010110010010001111111101110000
0111111111111111111111111111111111111111111110
0101010101010101010101010101010101010101010100
0101010101101011001101111000001100010110011110
0100110111101011110110010011111010011111101000
0100111011010100100011110011100000101101101010
0111000010001000011011010101001100011111111000
0100110111110110110100111001111011000110001110
0111000111001101010110010100111101011000100100
0100001000100110110111110010000111100101001010
0111011111001011000100011100100010111000000100
0111011011000100100111110010110110000011100010
0111010111101010101001011101110110101000000000
0100001111001011001011111101001001011110101010
0100001010000101100001011111011111001110111100
0101001110001110100100110010101001011000110110
0111000111000111010011011110010111111000100100
0100100101001111110100111010111010001110111110
0111011110110001001000011000111110111110100100
0101001100100111110111111111101101000010100110
0101010100000010011101011100111100111101000000
0111010101110100111111110011001101001101000110
0100110011101000111111010101100100110111000100
0111111111111111111111111111111111111111111110
0000000000000000000000000000000000000000000000