dirkx / base45-js Goto Github PK
View Code? Open in Web Editor NEWBase45 (for QR and Aztec barcode alphanumeric mode) library for Javascript/JS/node
Base45 (for QR and Aztec barcode alphanumeric mode) library for Javascript/JS/node
The included index.ds.ts file is not usable to use it directly in typescript projects
following content will work
export function encode(buffer: ArrayBuffer): string;
export function decode(str: string): ArrayBuffer;
Hello,
I notice that your code is not working correctly in some cases. For example here:
var test = new Uint8Array([120,156,75,244,51,201,14,14,45,9,41,203,1,0,18,222,3,161]);
console.log('Original text: ' + test.toString());
test = base45.encode(test)
console.log('Base45 encoded: ' + test);
test = base45.decode(test)
console.log('Base45 decoded: ' + test);
Produce the following log:
Original text: 120,156,75,244,51,201,14,14,45,9,41,203,1,0,18,222,3,161
Base45 encoded: 6BF4R9RO6/Y19V5YC5V50FH2TK0
Base45 decoded: 120,156,75,244,51,201,14,14,45,9,41,203,0,256,18,222,3,161
Is it normal that the decoded Uint8Array is not equals to the one provided for encode ?
Please note that the decoded Uint8Array generates an error when using zlib.inflate() function from https://github.com/nodeca/pako, but not the original one:
zlib.inflate(new Uint8Array([120,156,75,244,51,201,14,14,45,9,41,203,0,256,18,222,3,161]))
node_modules\pako\lib\inflate.js:384
if (inflator.err) throw inflator.msg || msg[inflator.err];
^
incorrect data check
package.json's main should reference "main": "lib/base45-js"
not "main": "lib/base45",
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.