mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-16 05:10:34 +00:00
25 lines
473 B
TypeScript
25 lines
473 B
TypeScript
import { MODE_8BIT_BYTE } from './QRMode';
|
|
|
|
class QR8bitByte {
|
|
mode: number;
|
|
data: string;
|
|
|
|
constructor (data: string) {
|
|
this.mode = MODE_8BIT_BYTE;
|
|
this.data = data;
|
|
}
|
|
|
|
getLength (): number {
|
|
return this.data.length;
|
|
}
|
|
|
|
write (buffer: { put: (arg0: number, arg1: number) => void }): void {
|
|
for (let i = 0; i < this.data.length; i++) {
|
|
// not JIS ...
|
|
buffer.put(this.data.charCodeAt(i), 8);
|
|
}
|
|
}
|
|
}
|
|
|
|
export default QR8bitByte;
|