1

Possible Duplicate:
How do I base64 encode (decode) in C?

I am trying to convert an int into an ASCII byte array and then encode the byte array as a base64 string.

I see a few posts on how to do this in C# and Java, but I want to do this in C. I'm doing this in windows, using MS Visual Studio.

Is there a function provided that can do this?

Here's the code that I would use in C# to do this:

var base64_string = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(my_integer));
Community
  • 1
  • 1
emge
  • 477
  • 2
  • 8
  • 20

1 Answers1

2

There are a lot of libraries available for that. One example is libb64, which has a very permissive license.

Heinzi
  • 167,459
  • 57
  • 363
  • 519