Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated pcsclite version && fixed buffer deprecated errors #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"author": "Tema Smirnov",
"license": "MIT",
"dependencies": {
"pcsclite": "^0.4.9"
"pcsclite": "^1.0.0"
},
"devDependencies": {
"babel-cli": "^6.7.5",
Expand Down
4 changes: 2 additions & 2 deletions src/Reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Reader extends EventEmitter {
}

static reverseBuffer(src) {
let buffer = new Buffer(src.length);
let buffer = Buffer.alloc(src.length);
for (var i = 0, j = src.length - 1; i <= j; ++i, --j) {
buffer[i] = src[j];
buffer[j] = src[i];
Expand All @@ -92,7 +92,7 @@ class Reader extends EventEmitter {

getTagUid(protocol) {

let packet = new Buffer([
let packet = Buffer.from([
0xFF, // Class
0xCA, // Ins
0x00, // P1: Get current card UID
Expand Down