Giter Club home page Giter Club logo

base64's Introduction

base64

A lightweight header-only library about base64 for C++(Requires C++11 or newer standards)
一个轻量级的base64的实现(要求C++11或更新的标准)

使用方式 | Usage

#include "base64.hpp"
#include <iostream>

auto main() ->int {
  // 编码 | Encode
  std::string s{"hello world"};
  std::string res1 = base64::encode(s);
  std::string res2 = base64::encode(s.begin(), s.end());
  std::string res3{};
  base64::encode_to(s, std::back_inserter(res3));
  std::cout << res1 << '\n';
  std::cout << res2 << '\n';
  std::cout << res3 << '\n';
  // 解码 | Decode
  std::string buff{};
  base64::decode_to(res1, std::back_inserter(buff));
  std::cout << buff << '\n';
  return 0;
}

output:

aGVsbG8gd29ybGQ=
aGVsbG8gd29ybGQ=
aGVsbG8gd29ybGQ=
hello world

base64's People

Contributors

cra3z avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.