Skip to content

Commit

Permalink
feat: qr-code correction level up to 30%
Browse files Browse the repository at this point in the history
  • Loading branch information
yarobash committed Nov 24, 2024
1 parent f1fbb21 commit 6f04aeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/widgets/qr-code-widget/QR-code-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function QRCodeWidget({ textToCode }: { textToCode: string }) {
const svgRef = useRef();
useEffect(() => {
const segs: Array<QrSegment> = QrSegment.makeSegments(textToCode);
const qr = QrCode.encodeSegments(segs, Ecc.QUARTILE, 1, 40, -1, true);
const qr = QrCode.encodeSegments(segs, Ecc.HIGH, 1, 40, -1, true);
const svgStr = toSvgString(qr, 2, '#fff', '#000');
const viewBox: string = (/ viewBox="([^"]*)"/.exec(svgStr) as RegExpExecArray)[1];
const pathD: string = (/ d="([^"]*)"/.exec(svgStr) as RegExpExecArray)[1];
Expand Down

0 comments on commit 6f04aeb

Please sign in to comment.