You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, we are using this library to encode output from json.Marshal into a qrcode.
but converting []byte to string is a copy operation, and we want to minimize that.
having qrcode.Encode variant that accept []byte instead of string would be great.
probably i'll be named qrcode.EncodeBytes, with that we could reuse buffer and probably improve performance.
The text was updated successfully, but these errors were encountered:
bokunodev
changed the title
accept and return []byte instead of string
qrcode.Encode accept and []byte instead of string
Dec 29, 2021
it's just a coding trick in go, you should use it to convert your []byte to string, and pass the string variable to QRcode library's API.
by the way, It is not necessary to care about the performance loss of converting between []byte and string at the most time except your application is highly realtime
Hi, we are using this library to encode output from
json.Marshal
into a qrcode.but converting
[]byte
tostring
is a copy operation, and we want to minimize that.having
qrcode.Encode
variant that accept[]byte
instead ofstring
would be great.probably i'll be named
qrcode.EncodeBytes
, with that we could reuse buffer and probably improve performance.The text was updated successfully, but these errors were encountered: