An efficient way to Base64 encode a byte array?

前端 未结 8 1849
再見小時候
再見小時候 2020-11-30 07:18

I have a byte[] and I\'m looking for the most efficient way to base64 encode it.

The problem is that the built in .Net method Convert.FromBase64

8条回答
  •  难免孤独
    2020-11-30 07:40

    Byte[] -> String: use system.convert.tobase64string

    Convert.ToBase64String(byte[] data)
    

    String -> Byte[]: use system.convert.frombase64string

    Convert.FromBase64String(string data)
    

提交回复
热议问题