Shane32/QRCoder là dự án phía máy chủ trên GitHub với 5.2k sao, viết chủ yếu bằng C#. A pure C# Open Source QR Code implementation
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
🌐 Cross-platform - Supports .NET 5+, .NET Framework 3.5+, .NET Core 1.0+, and .NET Standard 1.3+
📦 Micro QR codes - Smaller QR codes for space-constrained applications
📦 Installation
Install via NuGet Package Manager:
PM> Install-Package QRCoder
🚀 Quick Start
Generate a QR code with just a few lines of code, either using a renderer's static helper method, or by creating a QR code first and then passing it to a renderer:
using QRCoder;
// Generate a simple black and white PNG QR code
byte[] qrCodeImage = PngByteQRCodeHelper.GetQRCode("Hello World", QRCodeGenerator.ECCLevel.Q, 20);
// Generate a scalable black and white SVG QR code
using var qrCodeData = QRCodeGenerator.GenerateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q);
using var svgRenderer = new SvgQRCode(qrCodeData);
string svg = svgRenderer.GetGraphic();
For more examples and detailed usage instructions, see: Wiki: How to use QRCoder
📱 Payload Generators
QR codes can encode structured data that triggers specific actions when scanned (e.g., WiFi credentials, contact information, URLs). QRCoder includes payload generators that create properly formatted strings for these common use cases.
Usage Example
using QRCoder;
// Create a bookmark payload
var bookmarkPayload = new PayloadGenerator.Bookmark("https://github.com/Shane32/QRCoder", "QRCoder Repository");
// Generate the QR code data from the payload
using var qrCodeData = QRCodeGenerator.GenerateQrCode(bookmarkPayload);
// Or override the ECC level
using var qrCodeData2 = QRCodeGenerator.GenerateQrCode(bookmarkPayload, QRCodeGenerator.ECCLevel.H);
// Render the QR code
using var pngRenderer = new PngByteQRCode(qrCodeData);
byte[] qrCodeImage = pngRenderer.GetGraphic(20);
Available Payload Types
Payload Type
Usage Example
Description
WiFi
new PayloadGenerator.WiFi(ssid, password, auth)
WiFi network credentials
URL
new PayloadGenerator.Url("https://example.com")
Website URL
Bookmark
new PayloadGenerator.Bookmark(url, title)
Browser bookmark
Mail
new PayloadGenerator.Mail(email, subject, body)
Email with pre-filled fields
SMS
new PayloadGenerator.SMS(number, message)
SMS message
MMS
new PayloadGenerator.MMS(number, subject)
MMS message
Geolocation
new PayloadGenerator.Geolocation(lat, lng)
GPS coordinates
PhoneNumber
new PayloadGenerator.PhoneNumber(number)
Phone number for calling
SkypeCall
new PayloadGenerator.SkypeCall(username)
Skype call
WhatsAppMessage
new PayloadGenerator.WhatsAppMessage(number, msg)
WhatsApp message
ContactData
new PayloadGenerator.ContactData(...)
vCard/MeCard contact
CalendarEvent
new PayloadGenerator.CalendarEvent(...)
iCal/vEvent
OneTimePassword
new PayloadGenerator.OneTimePassword(...)
TOTP/HOTP for 2FA
BitcoinAddress
new PayloadGenerator.BitcoinAddress(address)
Bitcoin payment
BitcoinCashAddress
new PayloadGenerator.BitcoinCashAddress(address)
Bitcoin Cash payment
LitecoinAddress
new PayloadGenerator.LitecoinAddress(address)
Litecoin payment
MoneroTransaction
new PayloadGenerator.MoneroTransaction(...)
Monero payment
SwissQrCode
new PayloadGenerator.SwissQrCode(...)
Swiss QR bill (ISO-20022)
Girocode
new PayloadGenerator.Girocode(...)
SEPA payment (EPC QR)
BezahlCode
new PayloadGenerator.BezahlCode(...)
German payment code
RussiaPaymentOrder
new PayloadGenerator.RussiaPaymentOrder(...)
Russian payment (ГОСТ Р 56042-2014)
SlovenianUpnQr
new PayloadGenerator.SlovenianUpnQr(...)
Slovenian UPN payment
ShadowSocksConfig
new PayloadGenerator.ShadowSocksConfig(...)
Shadowsocks proxy config
For detailed information about payload generators, see: Wiki: Advanced usage - Payload generators
🎨 QR Code Renderers
QRCoder provides multiple renderers for different output formats and use cases. Each renderer has specific capabilities and framework requirements.
Renderer
Output Format
Requires
Usage Example
PngByteQRCode
PNG byte array
—
new PngByteQRCode(data).GetGraphic(20)
SvgQRCode
SVG string
—
new SvgQRCode(data).GetGraphic(20)
QRCode
System.Drawing.Bitmap
Windows¹
new QRCode(data).GetGraphic(20)
ArtQRCode
Artistic bitmap with custom images
Windows¹
new ArtQRCode(data).GetGraphic(20)
AsciiQRCode
ASCII art string
—
new AsciiQRCode(data).GetGraphic(1) or new AsciiQRCode(data).GetGraphicSmall()
Base64QRCode
Base64 encoded image
—
new Base64QRCode(data).GetGraphic(20)
BitmapByteQRCode
BMP byte array
—
new BitmapByteQRCode(data).GetGraphic(20)
PdfByteQRCode
PDF byte array
—
new PdfByteQRCode(data).GetGraphic(20)
PostscriptQRCode
PostScript/EPS string
—
new PostscriptQRCode(data).GetGraphic(20)
XamlQRCode
XAML DrawingImage
XAML²
new XamlQRCode(data).GetGraphic(20)
UnityQRCode
Unity Texture2D
Unity³
new UnityQRCode(data).GetGraphic(20)
Notes:
¹ Requires Windows or System.Drawing.Common package (uses GDI+)
² Requires the QRCoder.Xaml package
³ Requires the QRCoder.Unity package
Framework Compatibility: Not all renderers are available on all target frameworks. Check the compatibility table for details.
For comprehensive information about renderers, see: Wiki: Advanced usage - QR Code renderers
🔧 Advanced Features
Micro QR Codes
QRCoder supports Micro QR codes, which are smaller versions of standard QR codes suitable for applications with limited space. Micro QR codes have significantly limited storage capacity—as few as 5 numeric digits (M1) or as many as 35 numeric digits (M4), with alphanumeric and byte data storing considerably less.
using QRCoder;
// Generate a Micro QR code (versions M1-M4, represented as -1 to -4)
using var qrCodeData = QRCodeGenerator.GenerateMicroQrCode("Hello", QRCodeGenerator.ECCLevel.L, requestedVersion: -2);
using var qrCode = new PngByteQRCode(qrCodeData);
byte[] qrCodeImage = qrCode.GetGraphic(20);
Note: Micro QR codes have limitations on data capacity and error correction levels. They support versions M1 through M4 (specified as -1 to -4), and not all ECC levels are available for all versions. M1 only supports detection (no ECC), M2 and M3 support L and M levels, and M4 supports L, M, and Q levels. For detailed capacity tables, see the Micro QR Code specification.
Working with QRCodeData
QRCodeData is the core data structure that represents a QR code's module matrix. It contains a List<BitArray> called ModuleMatrix, where each BitArray represents a row of modules in the QR code. A module is set to true for dark/black modules and false for light/white modules.
You can access the ModuleMatrix directly to read or manipulate the QR code data at the module level. This is useful for custom rendering implementations or analyzing QR code structure.
using QRCoder;
// Generate QR code data
using var qrCodeData = QRCodeGenerator.GenerateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q);
// Access the module matrix
var moduleMatrix = qrCodeData.ModuleMatrix;
int size = moduleMatrix.Count; // Size of the QR code (includes quiet zone)
// Manually render as ASCII (versus the included ASCII renderer)
for (int y = 0; y < size; y++)
{
for (int x = 0; x < size; x++)
{
// Check if module is dark (true) or light (false)
bool isDark = moduleMatrix[y][x];
Console.Write(isDark ? "██" : " ");
}
Console.WriteLine();
}
⚠️ Troubleshooting
System.Drawing.Common Warnings (QRCode and ArtQRCode renderers)
The QRCode and ArtQRCode renderers depend on System.Drawing.Common, which Microsoft has removed cross-platform support for in .NET 6+. You may encounter one of the following build or runtime errors:
CA1416: This call site is reachable on all platforms. 'QRCode.QRCode(QRCodeData)' is only supported on: 'windows'
System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
Solutions include:
Use Windows-specific TFMs such as <TargetFramework>net8.0-windows</TargetFramework>
Mark methods with the [SupportedOSPlatform("windows")] attribute
Add platform guards by wrapping code with #if WINDOWS or if (OperatingSystem.IsWindows())
Use cross-platform renderers such as PngByteQRCode, SvgQRCode, or BitmapByteQRCode
ISO-8859-2 Encoding Support (.NET Core and .NET 5+)
ISO-8859-2 encoding is not natively supported on .NET Core and .NET 5+. If you need to use ISO-8859-2 encoding in your code, you must:
Install the System.Text.Encoding.CodePages NuGet package
Register the encoding provider in your application startup code:
using System.Text;
// Register the code pages encoding provider
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Note that the RussiaPaymentOrder payload generator already includes this registration internally, so no additional setup is required when using that class.
🚀 CI Builds
The NuGet feed contains only major/stable releases. If you want the latest functions and features, you can use the CI builds via Github packages.
(More information on how to use Github Packages in Nuget Package Manager can be found here.)
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
📄 License
QRCoder is a project originally by Raffael Herrmann and was first released in 10/2013. It's licensed under the MIT license.
Since 2025, QRCoder has been maintained by Shane32 with contributions from the community.
🙏 Credits
Glory to Jehovah, Lord of Lords and King of Kings, creator of Heaven and Earth, who through his Son Jesus Christ, has redeemed me to become a child of God. -Shane32
Shane32/QRCoder thuộc nhóm Backend trên TopGit, cùng 8 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về Shane32/QRCoder ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Shane32/QRCoder là nguồn chính thức.
Shane32/QRCoder có bao nhiêu sao?
Shane32/QRCoder có 5.2k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/Shane32/QRCoder. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Shane32/QRCoder có phải mã nguồn mở không?
Có — Shane32/QRCoder phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/Shane32/QRCoder.
Shane32/QRCoder còn đang phát triển không?
Commit gần nhất trên Shane32/QRCoder là 10 ngày trước (theo timestamp GitHub). Repo có 1.2k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Shane32/QRCoder dùng license gì?
Shane32/QRCoder phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Shane32/QRCoder là gì?
Shane32/QRCoder (Shane32/QRCoder) là dự án C# trên GitHub. Theo mô tả gốc: A pure C# Open Source QR Code implementation
Shane32/QRCoder viết bằng ngôn ngữ gì?
Shane32/QRCoder chủ yếu viết bằng C#. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
QRCoder có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về QRCoder.