Skip to content

Commit

Permalink
🔖 bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
ManiaciaChao committed Jun 6, 2022
1 parent 0ac67ef commit 71b755b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const init = (options = {}) => {
let code = false;
while (!code) {
resp = await fetch(`https://pass.hust.edu.cn/cas/code?${Math.random()}`);
const captcha = await resp.buffer();
const captcha = await resp.arrayBuffer();
code = await recognize(captcha);
}
const form = {
Expand Down
3 changes: 1 addition & 2 deletions dist/recognize.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/// <reference types="node" />
export declare const recognize: (buffer: Buffer) => Promise<string>;
export declare const recognize: (ab: ArrayBuffer) => Promise<string>;
3 changes: 2 additions & 1 deletion dist/recognize.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const match = (pixels, digits) => {
}
return scores.indexOf(Math.max(...scores));
};
export const recognize = async (buffer) => {
export const recognize = async (ab) => {
const buffer = new Uint8Array(ab);
const data = await sharp(buffer, { page: 1 })
.extract({ left: 0, top: 19, width: 87, height: 20 })
.toColourspace("b-w")
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-hustpass",
"version": "2.2.0",
"version": "2.2.1",
"description": "HUSTPass auth library for Node.js. Node.js 华科统一身份认证库。",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
Expand Down

0 comments on commit 71b755b

Please sign in to comment.